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

ListItem formatting needs to deal with HardBreaks #38

Open
ronaldtse opened this issue Apr 23, 2024 · 0 comments · May be fixed by #126
Open

ListItem formatting needs to deal with HardBreaks #38

ronaldtse opened this issue Apr 23, 2024 · 0 comments · May be fixed by #126
Assignees
Milestone

Comments

@ronaldtse
Copy link
Contributor

For the ListItem class, the formatting needs to deal with HardBreaks too, if the list item contains multiple paragraphs or blocks.

Originally posted by @ronaldtse in #33 (comment)

@webdev778 webdev778 self-assigned this May 1, 2024
@webdev778 webdev778 moved this to 🏗 In progress in Metanorma Jul 1, 2024
@ronaldtse ronaldtse added this to the 1.0.0 milestone Jul 11, 2024
xyz65535 added a commit to xyz65535/coradoc that referenced this issue Sep 5, 2024
@xyz65535 xyz65535 linked a pull request Sep 5, 2024 that will close this issue
4 tasks
xyz65535 added a commit to xyz65535/coradoc that referenced this issue Sep 5, 2024
xyz65535 added a commit to xyz65535/coradoc that referenced this issue Nov 5, 2024
- ListItem: added attaching block paragraph/block/admonition
- List: added multiple tests in various combinations of the above e.g. nested lists, attached paragraph, attached admonition, two attached paragraphs, nested list with attached paragraph, nested list with attached multiline paragraph, attached paragraph and nested list

Important improvement: code in Coradoc::Parser::Asciidoc::Base that converts grammar rules written as ruby methods into proper parslet rules, which as it turned out was not the case previously. On top of that, it goes beyond what parslet is capable by also supporting arguments. Due to this improvement time for running all the tests came down (on tested hardware, approximately) from 50 seconds to 10 seconds (5x speedup) and time for running utils/round_trip.rb came down from 2.5 minutes to 3 seconds (50x speedup), which is also realistic input. This improvement makes it possible to iterate on grammar rules much faster, develop parsing inlines and potentially parsing input from various sources, for example test cases from asciidoc, in much more reasonable time.
- Coradoc::Parser::Asciidoc::Base was changed from a module to a class, rules previously contained there were moved to module Coradoc::Parser::Asciidoc::Text

Other improvements:
- Blocks: added missing block types: listing, open. added missing properties in literal block. (based on things noticed with utils/round_trip.rb)
- Grammar rules to be used inside of other rules e.g. line_start?, line_not_text?. Purpose of those rules is making sure rules using them are applied by parser only in places they should be applied.
- Tests for blocks, paragraph, table, two parsing bugs to be fixed
- Minor fixes in tests
@hmdne hmdne linked a pull request Nov 5, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

3 participants