lib/markdown: Fixed spacing issue in which a `then` was mistaken for a suffix
[nit.git] / lib / markdown / markdown.nit
index 9124ad7..7907409 100644 (file)
@@ -417,7 +417,7 @@ class MarkdownProcessor
                        end
                else if c == '_' then
                        if c1 == '_' then
-                               if c0 != ' ' or c2 != ' 'then
+                               if c0 != ' ' or c2 != ' ' then
                                        return new TokenStrongUnderscore(loc, pos, c)
                                else
                                        return new TokenEmUnderscore(loc, pos, c)
@@ -758,8 +758,11 @@ class HTMLDecorator
        end
 
        redef fun add_code(v, block) do
-               if block isa BlockFence and block.meta != null then
-                       v.add "<pre class=\"{block.meta.to_s}\"><code>"
+               var meta = block.meta
+               if meta != null then
+                       v.add "<pre class=\""
+                       append_value(v, meta)
+                       v.add "\"><code>"
                else
                        v.add "<pre><code>"
                end
@@ -1233,6 +1236,9 @@ end
 class BlockCode
        super Block
 
+       # Any string found after fence token.
+       var meta: nullable Text
+
        # Number of char to skip at the beginning of the line.
        #
        # Block code lines start at 4 spaces.
@@ -1259,9 +1265,6 @@ end
 class BlockFence
        super BlockCode
 
-       # Any string found after fence token.
-       var meta: nullable Text
-
        # Fence code lines start at 0 spaces.
        redef var line_start = 0
 end