-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect code in pre-tag using indicators and fix code formatting issues #776
base: master
Are you sure you want to change the base?
Conversation
7bb8466
to
25085f7
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #776 +/- ##
=======================================
Coverage 99.27% 99.27%
=======================================
Files 21 21
Lines 3587 3594 +7
=======================================
+ Hits 3561 3568 +7
Misses 26 26 ☔ View full report in Codecov by Sentry. |
Hi @steineggerroland, thanks for the PR, could you please address the issue above? The rest looks fine! |
3e4fb16
to
4981d37
Compare
4981d37
to
cb70ec4
Compare
@steineggerroland Thanks for taking the time to do the tests! I'm fine with your solution, there is a remaining problem with mypy on Python 3.13 though. |
Tackles #775 and an issue mentioned in #553.
Regarding #775 which mentions problems in detecting code blocks using just
<pre>
-tag:convert_quotes
is extended so that it uses a list of indicators to verify, if the element is a quote or a code block. If a code indicator is detected within the element, its expected to be a code block.Suggested indicators to start with are:
{
,("
,('
,\n
Regarding #553:
Quote: "btw. here is another bug (maybe) when extracting inline code block, a redundant '\n' was added after a inline code block now result"
I changed how the line break is added to
code
blocks. I removedcode
as "NEWLINE_ELEMS" which currently leads to the line break. Instead the line break is now added when convertingcode
to text if its a multiline block.While fixing this issue another problem arose. A space is added after inline code. I fixed this issue making
code
a "SPECIAL_FORMATTING" element.Issue with breaking code is tackled, too.
Line breaks are converted to \n within code blocks. There might be an issue with spaces which definitely needs to be addressed as mentioned in #553.