ford icon indicating copy to clipboard operation
ford copied to clipboard

Markdown line breaks not working in lists

Open jatkinson1000 opened this issue 1 year ago • 2 comments
trafficstars

I have a list in my documentation page, and I want to insert a line break in some of the list items. Usually in markdown I would use a trailing \ (works in GitHub, GitLab and more generally elsewhere).

However, when the html is created with FORD there is no line break and instead the '' appears as part of the rendered text. As a workaround I have to resort to using a <br> instead which is less 'markdownthonic'.

If the <br> didn't work either I'd guess the inputs were getting sanitised somewhere to cause this, but I'm not sure why it happens. It'd be a 'nice to have' functionality.

My specific example with <br> where I'd prefer to use \:

* Reducing the overheads for coupling PyTorch machine learning models to Fortran<br>
  ML & DL Seminars, LSCE, IPSL, Paris - November 2023<br>
  [Slides](https://jackatkinson.net/slides/IPSL_FTorch/IPSL_FTorch.html) - [Recording](https://www.youtube.com/watch?v=-NJGuV6Rz6U)
* Reducing the Overhead of Coupled Machine Learning Models between Python and Fortran<br>
  RSECon23, Swansea - September 2023<br>
  [Slides](https://jackatkinson.net/slides/RSECon23/RSECon23.html) - [Recording](https://www.youtube.com/watch?v=Ei6H_BoQ7g4&list=PL27mQJy8eDHmibt_aL3M68x-4gnXpxvZP&index=33)

jatkinson1000 avatar Apr 07 '24 01:04 jatkinson1000

Ah, it seems the training \ is a CommonMark only thing. I'll see if two trailing spaces work, though I dislike this approach as it can be harder to see and trailing whitespace is generally discouraged.

jatkinson1000 avatar Apr 09 '24 15:04 jatkinson1000

Yes, it's unfortunate that Markdown has so many variations and dialects. Nowadays, there's MyST which is a superset of CommonMark with an emphasis on features for scientific writing which would be quite nice to use.

In principle we could swap out the markdown library for another one that supported other dialect(s), and this might also improve performance, but I wouldn't want to break existing projects, so it would have to be optional.

We also have some custom plugins to add some functionality that would need porting, which is another challenge

ZedThree avatar Apr 09 '24 16:04 ZedThree