-
Notifications
You must be signed in to change notification settings - Fork 854
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
wrapLines
breaks some code highlighting; fix included
#461
Comments
(I absolutely love this presentation framework by the way, have been using it for years and extoll the virtues of it everywhere I present ❤️ - I've even got an awesome setup now with Browsersync where when you save your markdown file the browser automatically replaces all the slides instantly and jumps to the first edited slide which has increased my productivity significantly!) |
For those interested in my workflow, check out this script: https://github.com/GraphQLTraining/lightweight-graphql-react/blob/gh-pages/browsersync And the corresponding https://github.com/GraphQLTraining/lightweight-graphql-react/blob/gh-pages/index.html |
Oh, this is great, @benjie! I wish I didn't have to hack remark to make it highlight 'jsx' properly. I would settle for an option to disable "highlight.js" and the remark code blocks altogether so I could simply link in my preferred highlighter (prism.js) for my |
I'm using your changes to (remark.prism.js) to have the syntax highlight and it works fine. Thank you. |
Where
wrapLines
splits the code content on\n
and wraps it in<div>
s if the highlighter opens a<span>
on one line and doesn't close it until the next line the browser will auto-close the span in the first div and the second line won't inherit the styles. This causes code formatting to appear broken - I thought it was an issue with highlight.js so switched out for prism as seen in #444 but it persisted.remark/src/remark/views/slideView.js
Lines 281 to 292 in 868781c
I've managed to work around the issue by pre-empting this in my
highlightBlock
override and closing spans out at the end of a line and re-opening them at the beginning of the next line. ES6 code to achieve this is here:Perhaps you'd consider incorporating the part from
const lines = html.split...
tolines.join('\n')
into thewrapLines
function directly?The text was updated successfully, but these errors were encountered: