question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

triple backticks in a cell

See original GitHub issue

I remember once trying out Jupytext and the very first thing I tried was converting a notebook to markdown that contains a cell with three backticks in it, since I wanted to see how Jupytext solves this problem:

a = """
```
foo
```
"""

image

It turns out Jupytext doesn’t solve this problem, and just produces a markdown file that looks like this

image

I think this is a bug.

I was reminded of this, because I just learned how to properly include three backticks in a fenced markdown code block. It’s very clever. The fence is allowed to be any number $\geq 3$ of backticks in a row, so if you just happened to want to include say 4 backticks in a row inside a fenced code block, you instead use five backticks in a row for the fence like I’m doing right here in Github:

four backticks here: ````

I’m impressed with markdown. 🤷

In any case, perhaps it would be good to implement this in jupytext. Anything that correctly parses markdown will then work properly, and some unusually notebooks won’t mysteriously break.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mwoutscommented, Jan 27, 2021

Hi @williamstein , the issue should be dealt with the merged PR. Do you want to give a try to the development version?

pip install git+https://github.com/mwouts/jupytext.git

or

BUILD_JUPYTERLAB_EXTENSION=1 pip install git+https://github.com/mwouts/jupytext.git

if you want the extension for JupyterLab (requires nodejs).

By the way, please let us know if there is any other pattern that you would like to see supported!

0reactions
mwoutscommented, Jan 14, 2021

Sure. Thanks for the suggestions, I’ll give them a try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdown Cells - GitHub Pages
Text can be added to Jupyter Notebooks using Markdown cells. ... Github flavored markdown meaning that you can use triple backticks for code...
Read more >
Regex, matching backticks not nested within triple backticks
I'm trying to match strings that are surrounded by backtick's but they aren't surrounded by triple backtick's. For example: match: `I should be ......
Read more >
Display issue of three-backticks formatted code
I came across an answer on Stack Overflow whose code is formatted with triple backticks (AKA CommonMark / GitHub style / ```), that...
Read more >
Markdown and Text cells | Learn | Hex Technologies
You can highlight variables in your text by wrapping your text in backticks (``), or you can use 3 backticks before and after...
Read more >
PSA: how to quote code with backticks - Julia Discourse
Open and close displayed code with triple backticks ``` . The julia after the first ``` specifies the ... Cell output in Jupyter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found