src/Pure/Thy/presentation.scala
changeset 74682 ce4adcc85f6c
parent 74679 0efa6a8b6e20
child 74683 c8327efc7af1
equal deleted inserted replaced
74681:84e5b4339db6 74682:ce4adcc85f6c
   147           (List(HTML.par(body1)), offset)
   147           (List(HTML.par(body1)), offset)
   148         case XML.Elem(Markup(Markup.MARKDOWN_ITEM, _), body) =>
   148         case XML.Elem(Markup(Markup.MARKDOWN_ITEM, _), body) =>
   149           val (body1, offset) = html_body(body, end_offset)
   149           val (body1, offset) = html_body(body, end_offset)
   150           (List(HTML.item(body1)), offset)
   150           (List(HTML.item(body1)), offset)
   151         case XML.Elem(Markup(Markup.Markdown_Bullet.name, _), text) =>
   151         case XML.Elem(Markup(Markup.Markdown_Bullet.name, _), text) =>
   152           (Nil, end_offset - Symbol.length(Symbol.decode(XML.content(text))))
   152           (Nil, end_offset - Symbol.length(XML.content(text)))
   153         case XML.Elem(Markup.Markdown_List(kind), body) =>
   153         case XML.Elem(Markup.Markdown_List(kind), body) =>
   154           val (body1, offset) = html_body(body, end_offset)
   154           val (body1, offset) = html_body(body, end_offset)
   155           if (kind == Markup.ENUMERATE) (List(HTML.enum(body1)), offset)
   155           if (kind == Markup.ENUMERATE) (List(HTML.enum(body1)), offset)
   156           else (List(HTML.list(body1)), offset)
   156           else (List(HTML.list(body1)), offset)
   157         case XML.Elem(markup, body) =>
   157         case XML.Elem(markup, body) =>
   167           Rendering.foreground.get(name) orElse Rendering.text_color.get(name) match {
   167           Rendering.foreground.get(name) orElse Rendering.text_color.get(name) match {
   168             case Some(c) => (html_class(c.toString, html), offset)
   168             case Some(c) => (html_class(c.toString, html), offset)
   169             case None => (html_class(name, html), offset)
   169             case None => (html_class(name, html), offset)
   170           }
   170           }
   171         case XML.Text(text) =>
   171         case XML.Text(text) =>
   172           val decoded = Symbol.decode(text)
   172           val offset = end_offset - Symbol.length(text)
   173           val offset = end_offset - Symbol.length(decoded)
   173           val body = HTML.text(Symbol.decode(text))
   174           val body = HTML.text(decoded)
       
   175           entity_anchor(context, Text.Range(offset, end_offset), body) match {
   174           entity_anchor(context, Text.Range(offset, end_offset), body) match {
   176             case Some(body1) => (List(body1), offset)
   175             case Some(body1) => (List(body1), offset)
   177             case None => (body, offset)
   176             case None => (body, offset)
   178           }
   177           }
   179       }
   178       }
   180 
   179 
   181     html_body(xml, Symbol.length(Symbol.decode(XML.content(xml))) + 1)._1
   180     html_body(xml, Symbol.length(XML.content(xml)) + 1)._1
   182   }
   181   }
   183 
   182 
   184 
   183 
   185   /* PIDE HTML document */
   184   /* PIDE HTML document */
   186 
   185