Defect #2830

trac lists aren't imported as such

Added by Daniel Svensson about 10 years ago. Updated over 6 years ago.

Status:NewStart date:2009-02-24
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Importers
Target version:-
Resolution: Affected version:0.8.1

Description

1. a
 1. a
 1. a
1. a
1. a

Should be converted to:

# a
## a
## a
# a
# a

History

#1 Updated by Mathias Kühn about 10 years ago

Check Patch #2748 for an updated version of the importer which fixes that issue beside others.

#2 Updated by Daniel Svensson about 10 years ago

Ah cool.. here's my solution, it's a bit more strict but does essentially the same thing.

Add following to convert_wiki_text:

  # alpha/numeric lists
  text = text.gsub(/(^[ ]+)(\d+|[a-zA-Z])\.[ ]/) { |s| '#' * $1.length + ' '}
  # bullet lists
  text = text.gsub(/(^[ ]+)\*[ ]/) { |s| '*' * $1.length + ' '}

Test cases:

puts convert_wiki_text(" 1. test")
puts convert_wiki_text("  1. test")
puts convert_wiki_text(" * test")
puts convert_wiki_text("  * test")
puts convert_wiki_text(" a. test")
puts convert_wiki_text("  a. test")

Output:

# test
## test
* test
** test
# test
## test

#3 Updated by Daniel Felix over 6 years ago

Any news on this?
Is anyone able to reproduce this with the current trunk?

Also available in: Atom PDF