Comments (22)
ah beautiful - thanks so much for following up on this @flying-sheep ! I didn't realize that this was now valid HTML, so I've learned something new today :-)
Let's keep this issue open so that we can follow up w/ kramdown later. @gaow does this work OK for you?
from jupyter-book.
Sure thank you @choldgraf for reporting it. Thank you @flying-sheep for your input!
from jupyter-book.
Ah, I see! I’d assumed that kramdown had a new release since 2018 😄
from jupyter-book.
hmmm - it looks like the actual generated HTML isn't using the <
and >
characters, instead it's coding them with <
and >
so they're being rendered as characters and not as HTML syntax. Is there a way to check on your end to see if that's what the R table renderer is doing (as opposed to this happening within Jupyter book?)
from jupyter-book.
Thanks @choldgraf for your prompt feedback. I've created a minimal working example here
The Untitled.ipynb
is a notebook using R kernel. If you open it with plain text editor you see the HTML table rendering seems fine. The Untitled.md
is the markdown file generated by script generate_book.py
which also looks good. I suspect it has something to do with the jekyll rendering step.
For my example in the original post, you are right, the coding is indeed <
and >
in the HTML:
</code></pre></div></div>
<div class="output output_html">
<table>
<thead><tr><th scope=col>DSC</th><th scope=col>simulate</th><th scope=col>simulate.true_mean</th><th scope=col>analyze</th><th scope=col>analyze.est_mean</th><th scope=col>score</th><th scope=col>score.error</th></tr></thead>
from jupyter-book.
huh, that is really weird, I agree that it seems the markdown produced by generate_book is fine, but I have no idea why jekyll would only encode just this one line. I'll try looking into it
from jupyter-book.
ah - I think I see what the problem is - the thead
section is actually not valid HTML because of the scope=col
sections. I think it should be scope="col"
and I tried adding quotes that it started working once I did this. Maybe Jekyll sees that it isn't valid HTML and so tries to encode it as "regular" text instead?
from jupyter-book.
ahh indeed. Thanks for identifying the problem so quickly. It looks like a Jupyter Notebook problem with R kernel then, because the syntax in the ipynb
file is already wrong ... maybe an upstream fix at Jupyter's end is the best fix?
from jupyter-book.
I'm guessing it's a problem with the R kernel that you're using, is it IRKernel?
from jupyter-book.
Yes it is IRKernel
. I'm on the current cran version 0.8.15. Perhaps we should open a ticket at their repo? For the time being do you suggest parsing all HTML fixing this particular problem (or would like to do it on your end)?
from jupyter-book.
Yeah I'd open an issue about it there. I don't think there's anything we can do on the jupyter book side, unfortunately. Let me know if you can think of something!
from jupyter-book.
Thank you I've opened a ticket (see above). For the time being I'd just run an additional perl
command to replace those patterns in the md
file under _build
, until there is an upstream fix. I'm cool if you want to close the ticket.
from jupyter-book.
sounds good! let's keep it open until we hear something back from that issue, because if a fix doesn't happen then we should probably document this in the book guide
from jupyter-book.
ah - I think I see what the problem is - the
thead
section is actually not valid HTML because of thescope=col
sections. I think it should bescope="col"
and I tried adding quotes that it started working once I did this. Maybe Jekyll sees that it isn't valid HTML and so tries to encode it as "regular" text instead?
Hi! I’m the author of repr (the package used by IRkernel rendering that HTML). Unquoted attribute values have been valid in HTML4 and continue to be so in HTML5. Whatever HTML parser is used here has a bug that needs to be fixed.
That bug is probably either in nbcleaner or something else active before the creation of the Jekyll Markdown, or it’s in the Markdown+HTML parser used by Jekyll.
/edit: I just checked: the emitted markdown contains the HTML unchanged, so it’s Jekyll’s default markdown parser, kramdown.
PS: I’m not obnoxiously against changing the HTML I emit, but I want to see an honest effort to fix the actual bug before I do that.
from jupyter-book.
I did a bit of research and… this will be fixed in the next version of kramdown: gettalong/kramdown#523
So you just need to wait, ask @gettalong for a new kramdown release, or use the git version of kramdown and everything is peachy.
from jupyter-book.
I didn't realize that this was now valid HTML, so I've learned something new today :-)
great! i’m happy that i could be of value!
however I can’t resist: now? 😆 it has been valid since at least 21 years (HTML 4.0, 1998)
from jupyter-book.
LOL that is slightly embarassing
from jupyter-book.
don’t worry! there’s so many concepts and specs we’re required to know that we can hardly be expected to keep all their details in our minds.
from jupyter-book.
Closing as this should be superceded by beta.jupyterbook.org!
from jupyter-book.
Well, it’s been fixed anyway. In your words:
Let's keep this issue open so that we can follow up w/ kramdown later.
from jupyter-book.
yeah - the reason it's superceded is because we're not going to use kramdown in the new build system 👍
from jupyter-book.
from jupyter-book.
Related Issues (20)
- Bump Sphinx dependency to allow v. 6 and 7 HOT 1
- IPython.display with LaTeX does not render in book
- struggling with the {exercise} MyST directove HOT 2
- dirhtml-builder uses html-builder canonical link HOT 1
- Variable substitution does not work HOT 2
- Adding parse.myst_enable_extensions to _config.yml breaks callouts HOT 2
- figure image formats HOT 1
- Unnecessary "the" and broken URL in /start HOT 1
- Process to consolidate all chapters into 1 single PDF book HOT 2
- Issue on page /content/citations.html
- Sphinx config `navigation with keys` removes links to Github HOT 1
- Cannot generate tab-sets, tab items or anything from myst from within python code cell HOT 1
- Error: Couldn't find a Table of Contents file. HOT 5
- reference to the notebook interface in the doc is for nbclassic
- Move to application distribution model HOT 13
- MyST Evaluation fails: no running kernel found HOT 6
- Problem with Utterances HOT 1
- Change from unmaintained pyppeteer package to alternative for building PDF documents from book HOT 1
- Update boilerplate code to use main branch by default instead of master HOT 1
- Allow the same document in multiple chapters/sections
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jupyter-book.