lib/markdown: remove some dead code
[nit.git] / lib / markdown / markdown.nit
index 7c91ecc..5b73d3b 100644 (file)
@@ -387,6 +387,7 @@ class LinkRef
        # Is the link an abreviation?
        var is_abbrev = false
 
+       # Create a link with a title.
        init with_title(link: String, title: nullable String) do
                self.link = link
                self.title = title
@@ -914,13 +915,18 @@ end
 class BlockCode
        super Block
 
+       # Number of char to skip at the beginning of the line.
+       #
+       # Block code lines start at 4 spaces.
+       protected var line_start = 4
+
        redef fun emit(v) do v.decorator.add_code(v, self)
 
        redef fun emit_lines(v) do
                var line = block.first_line
                while line != null do
                        if not line.is_empty then
-                               v.decorator.append_code(v, line.value, 4, line.value.length)
+                               v.decorator.append_code(v, line.value, line_start, line.value.length)
                        end
                        v.addn
                        line = line.next
@@ -934,6 +940,9 @@ end
 # this class is only used for typing purposes.
 class BlockFence
        super BlockCode
+
+       # Fence code lines start at 0 spaces.
+       redef var line_start = 0
 end
 
 # A markdown headline.
@@ -1102,6 +1111,7 @@ class MDLine
        # Is the next line empty?
        var next_empty: Bool = false is writable
 
+       # Initialize a new MDLine from its string value
        init(value: String) do
                self.value = value
                self.leading = process_leading
@@ -1322,7 +1332,6 @@ class LineOther
                        line = line.next
                end
                # build block
-               var bk: Block
                if line != null and not line.is_empty then
                        var block = v.current_block.split(line.prev.as(not null))
                        if v.in_list and not was_empty then
@@ -1560,6 +1569,7 @@ class LineList
        # Create a new block kind based on this line.
        protected fun block_kind(block: MDBlock): BlockList is abstract
 
+       # Extract string value from `MDLine`.
        protected fun extract_value(line: MDLine): String is abstract
 end
 
@@ -1962,7 +1972,6 @@ redef class Text
                var c0: Char
                var c1: Char
                var c2: Char
-               var c3: Char
 
                if pos > 0 then
                        c0 = self[pos - 1]
@@ -1981,11 +1990,6 @@ redef class Text
                else
                        c2 = ' '
                end
-               if pos + 3 < length then
-                       c3 = self[pos + 3]
-               else
-                       c3 = ' '
-               end
 
                if c == '*' then
                        if c1 == '*' then