Originally posted by chrisv2 January 8, 2023
The following markup will break section editing (due to the #
in the fenced code block):
# Section 1 Section 1 Lorem ipsum dolor sit amet ```python # hello world print("hello world") ``` # Section 2 Section 2 Lorem ipsum dolor sit ametExpected result
When clicking the "edit" link next to "Section 2", the editor should show the following markup:
# Section 2 Section 2 Lorem ipsum dolor sit ametActual result
The editor shows parts of the fenced code block:
# hello world print("hello world") ``` # Section 2 Section 2 Lorem ipsum dolor sit ametNotes
Actually it is surprisingly hard to create a proper fix for that, as it is not possible to get source line numbers from the markdown parser. Currently, the editsection plugin parses the source itself by using regexes, but that doesn't account for fenced code blocks, and it's probably quite difficult to do this with regex alone. IMHO we could do one of the following:
h[1-6]
with the source line, then find them in the markupI'm interested in hacking at this, but I'm not sure which is the best approach. Any thoughts?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4