lib/markdown: suppress super notation with `^`.
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 20 Nov 2014 02:55:26 +0000 (21:55 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 20 Nov 2014 03:08:51 +0000 (22:08 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/markdown/markdown.nit

index add43e1..41e2441 100644 (file)
@@ -335,12 +335,6 @@ class MarkdownProcessor
                        return new TokenHTML(pos, c)
                else if c == '&' then
                        return new TokenEntity(pos, c)
-               else if c == '^' then
-                       if c0 == '^' or c1 == '^' then
-                               return new TokenNone(pos, c)
-                       else
-                               return new TokenSuper(pos, c)
-                       end
                else
                        return new TokenNone(pos, c)
                end
@@ -519,9 +513,6 @@ interface Decorator
        # Render a strong text.
        fun add_strong(v: MarkdownEmitter, text: Text) is abstract
 
-       # Render a super text.
-       fun add_super(v: MarkdownEmitter, text: Text) is abstract
-
        # Render a link.
        fun add_link(v: MarkdownEmitter, link: Text, name: Text, comment: nullable Text) is abstract
 
@@ -635,12 +626,6 @@ class HTMLDecorator
                v.add "</strong>"
        end
 
-       redef fun add_super(v, text) do
-               v.add "<sup>"
-               v.add text
-               v.add "</sup>"
-       end
-
        redef fun add_image(v, link, name, comment) do
                v.add "<img src=\""
                append_value(v, link)
@@ -2038,23 +2023,6 @@ class TokenEscape
        end
 end
 
-# A markdown super token.
-class TokenSuper
-       super Token
-
-       redef fun emit(v) do
-               var tmp = v.push_buffer
-               var b = v.emit_text_until(v.current_text.as(not null), pos + 1, self)
-               v.pop_buffer
-               if b > 0 then
-                       v.decorator.add_super(v, tmp)
-                       v.current_pos = b
-               else
-                       v.addc char
-               end
-       end
-end
-
 redef class Text
 
        # Get the position of the next non-space character.