streamdown 0.23.0__py3-none-any.whl → 0.24.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- streamdown/sd.py +8 -2
- {streamdown-0.23.0.dist-info → streamdown-0.24.0.dist-info}/METADATA +1 -1
- streamdown-0.24.0.dist-info/RECORD +9 -0
- streamdown-0.23.0.dist-info/RECORD +0 -9
- {streamdown-0.23.0.dist-info → streamdown-0.24.0.dist-info}/WHEEL +0 -0
- {streamdown-0.23.0.dist-info → streamdown-0.24.0.dist-info}/entry_points.txt +0 -0
- {streamdown-0.23.0.dist-info → streamdown-0.24.0.dist-info}/licenses/LICENSE.MIT +0 -0
streamdown/sd.py
CHANGED
|
@@ -481,7 +481,12 @@ def line_format(line):
|
|
|
481
481
|
tokenList = re.finditer(r"((~~|\*\*_|_\*\*|\*{1,3}|_{1,3}|`+)|[^~_*`]+)", line)
|
|
482
482
|
result = ""
|
|
483
483
|
|
|
484
|
+
last_pos = 0
|
|
484
485
|
for match in tokenList:
|
|
486
|
+
if match.span()[0] > last_pos:
|
|
487
|
+
result += line[last_pos:match.span()[0]]
|
|
488
|
+
|
|
489
|
+
last_pos = match.span()[1]
|
|
485
490
|
token = re.sub(r'\s+',' ', match.group(1))
|
|
486
491
|
next_token = line[match.end()] if match.end() < len(line) else ""
|
|
487
492
|
prev_token = line[match.start()-1] if match.start() > 0 else ""
|
|
@@ -509,6 +514,7 @@ def line_format(line):
|
|
|
509
514
|
state.code_buffer_raw += token
|
|
510
515
|
|
|
511
516
|
elif token == '~~' and (state.in_strikeout or not_text(prev_token)):
|
|
517
|
+
print("in strike")
|
|
512
518
|
state.in_strikeout = not state.in_strikeout
|
|
513
519
|
result += STRIKEOUT[0] if state.in_strikeout else STRIKEOUT[1]
|
|
514
520
|
|
|
@@ -797,8 +803,8 @@ def parse(stream):
|
|
|
797
803
|
#print("(",highlighted_code,")")
|
|
798
804
|
|
|
799
805
|
# Sometimes the highlighter will do things like a full reset or a background reset.
|
|
800
|
-
# This is not what we want
|
|
801
|
-
highlighted_code = re.sub(r"\033\[[34]9(;00|)m",
|
|
806
|
+
# This is mostly not what we want
|
|
807
|
+
highlighted_code = re.sub(r"\033\[[34]9(;00|)m", "\033[23m", highlighted_code)
|
|
802
808
|
|
|
803
809
|
# Since we are streaming we ignore the resets and newlines at the end
|
|
804
810
|
if highlighted_code.endswith(FGRESET + "\n"):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: streamdown
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.24.0
|
|
4
4
|
Summary: A streaming markdown renderer for modern terminals with syntax highlighting
|
|
5
5
|
Project-URL: Homepage, https://github.com/kristopolous/Streamdown
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/kristopolous/Streamdown/issues
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
streamdown/sd.py,sha256=WH56QV5hYGKGT3rEPDuuzDk0lMEsHuLhdVtKvEdvtxE,42334
|
|
3
|
+
streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
|
|
4
|
+
streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
|
|
5
|
+
streamdown-0.24.0.dist-info/METADATA,sha256=yaD-DJOsxp9opkPiVItCGGx4vz5kXG5HoL7T60WOU7E,9658
|
|
6
|
+
streamdown-0.24.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
+
streamdown-0.24.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
|
|
8
|
+
streamdown-0.24.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
|
|
9
|
+
streamdown-0.24.0.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
streamdown/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
streamdown/sd.py,sha256=RgluaZCIs4ehoS-gy7Enieeqa2ohNaIzUnKvXb9I8nk,42143
|
|
3
|
-
streamdown/plugins/README.md,sha256=KWqYELs9WkKJmuDzYv3cvPlZMkArsNCBUe4XDoTLjLA,1143
|
|
4
|
-
streamdown/plugins/latex.py,sha256=xZMGMdx_Sw4X1piZejXFHfEG9qazU4fGeceiMI0h13Y,648
|
|
5
|
-
streamdown-0.23.0.dist-info/METADATA,sha256=57r-IXGwIS2lkrcpXt58CvCl8Ry4tzeKSMmNGyMD62I,9658
|
|
6
|
-
streamdown-0.23.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
7
|
-
streamdown-0.23.0.dist-info/entry_points.txt,sha256=HroKFsFMGf_h9PRTE96NjvjJQWupMW5TGP5RGUr1O_Q,74
|
|
8
|
-
streamdown-0.23.0.dist-info/licenses/LICENSE.MIT,sha256=SnY46EPirUsF20dZDR8HpyVgS2_4Tjxuc6f-4OdqO7U,1070
|
|
9
|
-
streamdown-0.23.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|