QuantEcon / sphinxcontrib-jupyter

A Sphinx Extension for Generating Jupyter Notebooks
BSD 3-Clause "New" or "Revised" License
76 stars 23 forks source link

Links with escaped characters #149

Closed arnavs closed 5 years ago

arnavs commented 5 years ago

Came up in https://github.com/quantecon/lecture-source-jl/pulls/384

In particular, we have wikipedia links like

`field <https://en.wikipedia.org/wiki/field_\(mathematics\)>`_

Which work fine in the generated Jupyter, but it looks like the trailing ) is missing in the HTML (see the generic_programming lecture for an example).

cc @jlperla @natashawatkins

jlperla commented 5 years ago

also, the following stopped at the \# escaping:

`Abstraction <https://en.wikipedia.org/wiki/Abstraction_\(computer_science\)\#Abstraction_in_object_oriented_programming>`_
mmcky commented 5 years ago

Thanks. So the generated output in the notebook has the extra ) but it looks well formed in the raw md. It looks like markdown is capturing the wrong bracket when rendering.

Thinking back to the mathematical motivation, a [Field](https://en.wikipedia.org/wiki/Field_(mathematics)) is an Ring with a few additional properties, among them

> - a multiplicative inverse: $ a^{-1} $  
- an inverse operation for multiplication: $ a / b = a \cdot b^{-1} $ 

and the rendering image

mmcky commented 5 years ago

I think the only solution here is to replace ( with %28 in the notebook

mmcky commented 5 years ago

The following PR will fix the bracket issue https://github.com/QuantEcon/sphinxcontrib-jupyter/pull/151 in links. Markdown uses the first ) so they have been replaced with %29 etc.