question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

order list <ol> without "start=" ?

See original GitHub issue

Hi,@vsch I want to render the text:

- 1. list1

- 2. list2

- 3. list3

But i get the result

<ul>
  <li>
    <ol>
      <li>list1</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>list2</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>list3</li>
    </ol>
  </li>
</ul>

i want to add the “start” attr to the <ol> except first <ol>,like:

<ul> 
 <li> 
  <ol> 
   <li>list1</li> 
  </ol> 
 </li> 
 <li> 
  <ol start="2"> 
   <li>list2</li> 
  </ol> 
</li> 
 <li> 
  <ol start="3"> 
   <li>list3</li> 
  </ol> 
 </li> 
 <li> 
<ul>

My code

	
   private static final DataHolder OPTIONS = PegdownOptionsAdapter.flexmarkOptions(
			(Extensions.ALL_WITH_OPTIONALS )
			).toMutable()
			.set(HtmlRenderer.FENCED_CODE_LANGUAGE_CLASS_PREFIX,"")	
			.set(HtmlRenderer.INDENT_SIZE, 2)							
			.set(Parser.LISTS_ITEM_INDENT, 2)							
			.set(TablesExtension.MIN_SEPARATOR_DASHES, 1)				

    private static final Parser parser = Parser.builder(OPTIONS).build();
    private static final HtmlRenderer renderer = HtmlRenderer.builder(OPTIONS).build();

Could you give me some advice?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, Aug 3, 2017

@GomiGuchi, issue opened #138

0reactions
vschcommented, Aug 3, 2017

@GomiGuchi, in general it is impossible to convert HTML to Markdown and have the markdown generate the same HTML. Markdown down is much more limited.

The HTML Parser is not intended as a 100% accurate conversion because it is not possible. It is more of a convenience for converting HTML to Markdown that should be examined and edited for desired results.

That said, if something obvious is messed up like the HTML to Markdown converter generating two consecutive lists without an intervening HTML comment then this is a bug in the HTML to Markdown converter. This needs its own issue. I’ll open it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<ol>: The Ordered List element - HTML - MDN Web Docs
This Boolean attribute specifies that the list's items are in reverse order. Items will be numbered from high to low. start. An integer...
Read more >
HTML ol start Attribute - W3Schools
The start attribute specifies the start value of the first list item in an ordered list. This value is always an integer, even...
Read more >
Ordered List (ol) showing up un-numbered? - Stack Overflow
It's going to be a CSS issue. CSS can change the numbering/bullet style, and even turn it off altogether. Using Firebug, inspect the...
Read more >
Ordered List in HTML – OL Tag Example - freeCodeCamp
An ordered list is a list in which the items are numbered and the order matters. This is as opposed to an unordered...
Read more >
HTML Lists - Without unordered ul, order ol & definition dl
The start attribute allows to indicate the start value, by which the ordered list has to start, this being a numeric value, in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found