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

feature(parser): custom subs on paragraphs #726

Merged

Conversation

xcoulon
Copy link
Member

@xcoulon xcoulon commented Jul 14, 2020

Support for one or more custom substitutions
Starting with Rawline elements which are parsed
and result in other elements. Subsequent substitutions
only apply on the StringElements.
At the end of the substitutions, the lines are preserved

Also, fix issues with single line comments which should not
start with spaces before the // marker

Fixes #597

Signed-off-by: Xavier Coulon [email protected]

@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #726 into master will decrease coverage by 0.01%.
The diff coverage is 80.20%.

@@            Coverage Diff             @@
##           master     #726      +/-   ##
==========================================
- Coverage   84.93%   84.91%   -0.02%     
==========================================
  Files          76       76              
  Lines        5224     5311      +87     
==========================================
+ Hits         4437     4510      +73     
- Misses        496      505       +9     
- Partials      291      296       +5     

@xcoulon
Copy link
Member Author

xcoulon commented Jul 14, 2020

marking this PR as "draft" since there are still some substitutions to implements and tests to add in the html5 and xhtml5 packages. And probably a bit of refactoring and code cleaning, too 😅

@xcoulon xcoulon force-pushed the Issue597_custom_subs_paragraphs branch 5 times, most recently from dd5d31b to 884c13a Compare July 21, 2020 20:30
make/go.mk Outdated
@@ -42,12 +42,12 @@ generate: install-pigeon
generate-optimized: install-pigeon
@echo "generating the parser (optimized)..."
@pigeon -optimize-parser \
-alternate-entrypoints AsciidocRawDocument,RawFile,TextDocument,DocumentRawBlock,FileLocation,IncludedFileLine,InlineLinks,LabeledListItemTerm,NormalBlockContent,NormalParagraphContent,VerseBlockContent,MarkdownQuoteBlockAttribution,InlineElements \
-alternate-entrypoints AsciidocRawDocument,RawFile,TextDocument,DocumentRawBlock,FileLocation,IncludedFileLine,InlineLinks,LabeledListItemTerm,NormalParagraphContentSubstitution,NormalBlockContentSubstitution,VerseBlockContentSubstitution,MarkdownQuoteBlockAttribution,InlineElements,QuotedTextSubstitution,NoneSubstitution,AttributesSubstitution,ReplacementsSubstitution \
Copy link
Collaborator

Choose a reason for hiding this comment

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

My PR that moves this to go generate will need to be updated if this merges first. Or vice versa.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, I've taken this change into account in my latest commit (I pushed with --force)

Support for one or more custom substitutions
Starting with Rawline elements which are parsed
and result in other elements. Subsequent substitutions
only apply on the StringElements.
At the end of the substitutions, the lines are preserved

Also, fix issues with single line comments which should not
start with spaces before the `//` marker

Fixes bytesparadise#597

Signed-off-by: Xavier Coulon <[email protected]>
@xcoulon xcoulon force-pushed the Issue597_custom_subs_paragraphs branch from fd51649 to 9c77a19 Compare August 2, 2020 12:20
@xcoulon xcoulon marked this pull request as ready for review August 2, 2020 12:45
@xcoulon xcoulon merged commit 5dcda32 into bytesparadise:master Aug 2, 2020
@xcoulon xcoulon deleted the Issue597_custom_subs_paragraphs branch August 2, 2020 12:48
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.

Custom substitutions on paragraphs
2 participants