-
Notifications
You must be signed in to change notification settings - Fork 188
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
resolves #342 replace pattern with generated code (no substitution) #343
resolves #342 replace pattern with generated code (no substitution) #343
Conversation
It would be nice to have something failing Travis that is fixed by that commit. To avoid regressions. |
If we want to make sure that client-side syntax highlighting is working then we need to open the HTML page in a browser and check that code block is highlighted. Another option is to invoke asciidoctor-doctest from the JavaScript toolchain: #144 |
Testing strategyAnother would be to diff the resulting converted examples from node to the ruby ones. I did an initial attempt at this: $ wdiff -3 examples/release-4.0.html release-4.0.html
======================================================================
[-charset="utf-8" /><meta-] {+charset="utf-8"><meta+}
======================================================================
[-minimal-ui" /><title>Asciidoctor-] {+minimal-ui"><title>Asciidoctor+}
======================================================================
[-href="reveal.js/css/reset.css" /><link-] {+href="reveal.js/css/reset.css"><link+}
======================================================================
[-href="reveal.js/css/reveal.css" /><link-] {+href="reveal.js/css/reveal.css"><link+}
======================================================================
[-id="theme" /><!--This-] {+id="theme"><!--This+}
======================================================================
[-href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/all.min.css" /><link-] {+href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/all.min.css"><link+}
======================================================================
[-href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/v4-shims.min.css" /><!--Printing-] {+href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/v4-shims.min.css"><!--Printing+}
======================================================================
[-href="release-4.0.css" /></head><body><div-] {+href="release-4.0.css"></head><body><div+}
======================================================================
[-logo" /></div>-] {+logo"></div>+}
====================================================================== The only differences are how some tags are closed differently. Being pragmatic, until we have proper doctest, this can be removed:
Do you think this idea is worth pursuing? I don't have time to pursue a Puppeteer approach nor implement doctest for the Javascript toolchain. But a rake task that does this seems easy to achieve and would have caught that bug. Anyways, I created issue #345. Back to the PRI tried it, it works. I'm going to merge this now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and it works!
It's a good compromise for now 👍 |
resolves #342