Ticket #5 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

Leading line of codeblock with more than one tab width of indent mistakenly unindented

Reported by: deveiant Owned by: deveiant
Priority: normal Milestone: Previous Releases
Component: MarkdownSyntax Version: 0.0.3
Severity: normal Keywords: old bugs
Cc:

Description

(From an email)

<pre><code> seems to have a problem. This input gives a different result to the "Dingus" Markdown testing page.

#----------------------------------------------------------------------------
Examples:
# (Waste character because first line is flush left !!!)
# Example script1
x = 1
x += 1
puts x
#----------------------------------------------------------------------------

# Blue Cloth
#-> <pre><code># (Waste character because first line is flush left)

# Dingus (markdown)
#-> <pre><code> # (Waste character because first line is flush left)
^^^^^^

My input is indented 10 (4 + 6). Four spaces (or one tab) are removed by Markdown, of course. Dingus inserts 6 spaces in the output and it is aligned with the lines which follow.

Change History

Changed 4 years ago by deveiant

  • status changed from new to assigned

Date: 2004-04-29 15:00[[br]] Sender: ged
Logged In: YES
user_id=158

(Original description has the example unindented):

Bug confirmed with a new test:

$ ./test.rb 
0 patterns given on the command line
Required 4 files.
Loaded suite BlueCloth
Started
.............................F...................................
..................
Finished in 0.971845 seconds.

  1) Failure:
test_399_preserve_leading_whitespace(SubfunctionsTestCase)
    [(eval):10:in `test_399_preserve_leading_whitespace'
     ./tests/bctestcase.rb:225:in `run']:
<"<p>Examples:</p>\n\n<pre><code>
# (Waste character because first line is flush left !!!)\n  
# Example script1\n      x = 1\n      x += 1\n      puts
x\n</code></pre>"> expected but was
<"<p>Examples:</p>\n\n<pre><code>#
(Waste character because first line is flush left !!!)\n    
# Example script1\n      x = 1\n      x += 1\n      puts
x\n</code></pre>">.

83 tests, 241 assertions, 1 failures, 0 errors

Changed 4 years ago by deveiant

  • status changed from assigned to closed
  • resolution set to fixed

Fixed by changing a String#strip to a String#rstrip. Committed in [34]. Closing.

Changed 4 years ago by deveiant

Fix committed in [38], not [34].

Note: See TracTickets for help on using tickets.