-
Notifications
You must be signed in to change notification settings - Fork 74
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
Replace AsciiDoctor/AsciiDoctorJ parser with simpler lightweight AsciiDoc parser #514
Conversation
👍 |
It works almost expected. The followings are the topics to improve.
And it would be great for you to add enough tests internal long methods such as convertToSentences, convertModel, Line constructor. eraseEnclosure etc. The tests are needed for me to understand and maintain the codes. |
Hi Ito-san, Thanks for having a look. Both tables and comments should already be ignored. For me, the following code prints one line "Potato":
Would it be possible to get the document you are testing with so I can see what you are seeing? I will add some internal test cases for the parser so you can see how it works. Best wishes, |
Update to the AsciiDoc parser. This should fix the reported issue. The problem was caused by an where a table block could, mistakenly, end an existing block. The Parser's inner classes have been moved to external classes, and moved to a new cc.redpen.parser.asciidoc package. This is to reduce the apparent complexity of the AsciiDocParser class. Some of the code has also been reworked to improve readability. Additional tests have been added to the test branch in cc.redpen.parser.asciidoc to test the inner workings of the asciidoc parser. |
Thanks a lot for the update! |
I've pushed an update that resolves the conflicts with the upstream changes |
LGTM |
Replace AsciiDoctor/AsciiDoctorJ parser with simpler lightweight AsciiDoc parser
This change replaces the existing AsciiDoc parser with a simpler AsciiDoc parser with no external dependencies.
This new parser generates a model of the source document which retains each character's original position, then proceeds to 'erase' the elements of the model that are recognized as AsciiDoc markup. The remaining characters are then converted into a RedPen document model.
The pom has been updated to remove asciidoctor/asciidoctorj and jruby related dependencies.