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

fix: Numbered Lists not incremental #58

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

fix: Numbered Lists not incremental #58

wants to merge 5 commits into from

Conversation

buddy-web3
Copy link
Member

No description provided.

parser/parser.js Outdated Show resolved Hide resolved
@@ -356,6 +356,7 @@ describe("parseParagraph", () => {
...paragraph,
bullet: { nestingLevel: 1, listId: "list-id" },
};
documentContext.orderedList = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add some more test cases for:

  • No orderedList set (should use the default)
  • More than one item (so the number goes up)
  • Multiple numbered lists in the same document
  • Multiple lists, both numbered and unnumbered in the same document

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having troubles getting the testsuite to write more than 1 line. adding \n makes the second line be part of the same Item, on a new line, padded.
Could you please give me an example test which has more than 1 item?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try using whatever gdocs returns for the doc that is causing this issue (after changing it to not be so verbose, of course)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @buddy-web3 , are you still working on this PR?
As far as I can tell, @mruwnik 's requested test cases haven't yet been added. Is this right? If so, happy to try to add the requested cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon you can take this over

@ChrisRimmer
Copy link
Collaborator

ChrisRimmer commented Jan 11, 2024

While this does make the markdown a little more clearly human-readable, that's not really a high priority as all the outlets I'm currently aware of are machine-parsed and rendered into other forms.

The markdown spec dictates that numbered lists are allowed to all be prefixed with the same number, and it's up to the renderer to behave correctly so the existing behaviour is entirely supported.

Is this something worth spending extra complexity on?

Sorry if this has already been talked about elsewhere - I'm very out of all of the loops lately :)

@buddy-web3
Copy link
Member Author

@ChrisRimmer
The markdown spec dictates that numbered lists are allowed to all be prefixed with the same number, and it's up to the renderer to behave correctly so the existing behaviour is entirely supported.

@ChrisRimmer
Copy link
Collaborator

@ChrisRimmer

markdown does not behave as described when there are new lines between the list items.

Fair enough. Erroneous gaps between list items seems like the more important thing to fix but who am I to dictate, I haven't worked on this in almost a year 😅

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

Successfully merging this pull request may close these issues.

4 participants