Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbered Lists - Continue numbering #59

Open
dwasyl opened this issue May 28, 2018 · 7 comments
Open

Numbered Lists - Continue numbering #59

dwasyl opened this issue May 28, 2018 · 7 comments

Comments

@dwasyl
Copy link

dwasyl commented May 28, 2018

Hi there,

I'm working on converting a few documents that have interrupted numbered lists and then the new list continues numbering from the original. I've gone through the XML and continued list items are correctly tagged with the same numId.

Since HTML has no ability to join lists, I considered either starting the new <ol> with the correct start value, or tagging each <li> with a value property.

From considering the two options, it looks like the <li value=X> option would be best. Would it be possible to keep an item count for each numbered lists style/id and then write the <li value=X> tag based on the current item number for that list style?

At the same time, is there a way to convert a numbered list to simple numbered paragraphs? OpenOffice converts numbered lists to HTML this way - although it still restarts even when it's a continuing list.

@mwilliamson
Copy link
Owner

Could you provide a minimal example document, the HTML that you're currently getting, and the HTML that you expect?

@dwasyl
Copy link
Author

dwasyl commented May 31, 2018

@mwilliamson Certainly can, should I just send it to the hello e-mail address?

EDIT:
In general though, what I'm referring to is a document setup like this:

1. List Item 1
2. List Item 2
Some non-list text
3. List item 3

By default List item 3 would be part of a new list and numbering would restart at 1, however, if the item is set to Continue Numbering then it gets set to the same list (numId) as the previous list and carries on the count. Currently when this is converted into HTML it looks like:

<ol>
  <li>List item 1</li>
  <li>List item 2</li>
</ol>
<p>Some non-list text</p>
<ol>
  <li>List item 3</li>
</ol>

This results in a numbering of:

1. List Item 1
2. List Item 2
Some non-list text
1. List item 3

The only way I could come up with to set the numbering for this type of list would be a value for each <li>, so the HTML would look like:

<ol>
  <li value="1">List item 1</li>
  <li value="2">List item 2</li>
</ol>
<p>Some non-list text</p>
<ol>
  <li value="3">List item 3</li>
</ol>

Another approach would be to flatten the list to show text (1., 2., 3.) instead of HTML (<ol><li>).

I will e-mail you some sample files and similar text.

@mwilliamson
Copy link
Owner

mwilliamson commented May 31, 2018 via email

@dwasyl
Copy link
Author

dwasyl commented May 31, 2018

@mwilliamson Did you see the edit to my reply? I tried to layout the current/desired HTML in quite a bit of detail. Is it clear enough? Have a sample docx file as well, just not sure how to attach it here.

@GitBruno
Copy link
Contributor

To attach a file to an issue or pull request conversation, drag and drop it into the comment box. The maximum size for files is 25MB and the maximum size for images is 10MB. Tip: If you're using Chrome, you can also copy-and-paste images directly into the box.

@dwasyl
Copy link
Author

dwasyl commented Aug 22, 2018

listsample.docx

@mwilliamson Attached is a very simple sample of continuing lists (and sub-lists). When numbering is continued it would be helpful to tag the generated list lis with a value, or at least the first element of the continued list (a style could be applied as well).

It would also be helpful to have a style defined for lists (instead of just generic ols and lis since Word lists can be numbered or lettered (a, b, c) or bulleted or even hyphenated. The more of this that can be detected and replicated the better.

@abdasik25
Copy link

Hi there, any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants