streamdown 0.23.0__tar.gz → 0.24.0__tar.gz

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.
Files changed (44) hide show
  1. {streamdown-0.23.0 → streamdown-0.24.0}/PKG-INFO +1 -1
  2. {streamdown-0.23.0 → streamdown-0.24.0}/pyproject.toml +1 -1
  3. {streamdown-0.23.0 → streamdown-0.24.0}/streamdown/sd.py +8 -2
  4. {streamdown-0.23.0 → streamdown-0.24.0}/.gitignore +0 -0
  5. {streamdown-0.23.0 → streamdown-0.24.0}/LICENSE.MIT +0 -0
  6. {streamdown-0.23.0 → streamdown-0.24.0}/README.md +0 -0
  7. {streamdown-0.23.0 → streamdown-0.24.0}/requirements.txt +0 -0
  8. {streamdown-0.23.0 → streamdown-0.24.0}/streamdown/__init__.py +0 -0
  9. {streamdown-0.23.0 → streamdown-0.24.0}/streamdown/plugins/README.md +0 -0
  10. {streamdown-0.23.0 → streamdown-0.24.0}/streamdown/plugins/latex.py +0 -0
  11. {streamdown-0.23.0 → streamdown-0.24.0}/tests/README.md +0 -0
  12. {streamdown-0.23.0 → streamdown-0.24.0}/tests/backtick-with-post-spaces.md +0 -0
  13. {streamdown-0.23.0 → streamdown-0.24.0}/tests/block.md +0 -0
  14. {streamdown-0.23.0 → streamdown-0.24.0}/tests/bold_reset_with_link.md +0 -0
  15. {streamdown-0.23.0 → streamdown-0.24.0}/tests/broken-code.md +0 -0
  16. {streamdown-0.23.0 → streamdown-0.24.0}/tests/broken-example.md +0 -0
  17. {streamdown-0.23.0 → streamdown-0.24.0}/tests/chunk-buffer.sh +0 -0
  18. {streamdown-0.23.0 → streamdown-0.24.0}/tests/cjk-table.md +0 -0
  19. {streamdown-0.23.0 → streamdown-0.24.0}/tests/cjk-wrap.md +0 -0
  20. {streamdown-0.23.0 → streamdown-0.24.0}/tests/code.md +0 -0
  21. {streamdown-0.23.0 → streamdown-0.24.0}/tests/example.md +0 -0
  22. {streamdown-0.23.0 → streamdown-0.24.0}/tests/fizzbuzz.md +0 -0
  23. {streamdown-0.23.0 → streamdown-0.24.0}/tests/inline.md +0 -0
  24. {streamdown-0.23.0 → streamdown-0.24.0}/tests/jimmy_webb.md +0 -0
  25. {streamdown-0.23.0 → streamdown-0.24.0}/tests/line-buffer.sh +0 -0
  26. {streamdown-0.23.0 → streamdown-0.24.0}/tests/line-wrap.md +0 -0
  27. {streamdown-0.23.0 → streamdown-0.24.0}/tests/links.md +0 -0
  28. {streamdown-0.23.0 → streamdown-0.24.0}/tests/managerie.md +0 -0
  29. {streamdown-0.23.0 → streamdown-0.24.0}/tests/mandlebrot.md +0 -0
  30. {streamdown-0.23.0 → streamdown-0.24.0}/tests/markdown.md +0 -0
  31. {streamdown-0.23.0 → streamdown-0.24.0}/tests/nested-example.md +0 -0
  32. {streamdown-0.23.0 → streamdown-0.24.0}/tests/outline.md +0 -0
  33. {streamdown-0.23.0 → streamdown-0.24.0}/tests/pvgo_512.jpg +0 -0
  34. {streamdown-0.23.0 → streamdown-0.24.0}/tests/pythonvgo.md +0 -0
  35. {streamdown-0.23.0 → streamdown-0.24.0}/tests/qwen3.md +0 -0
  36. {streamdown-0.23.0 → streamdown-0.24.0}/tests/rerun.zsh +0 -0
  37. {streamdown-0.23.0 → streamdown-0.24.0}/tests/slash.md +0 -0
  38. {streamdown-0.23.0 → streamdown-0.24.0}/tests/strip-chunks.sh +0 -0
  39. {streamdown-0.23.0 → streamdown-0.24.0}/tests/table-break.md +0 -0
  40. {streamdown-0.23.0 → streamdown-0.24.0}/tests/table_test.md +0 -0
  41. {streamdown-0.23.0 → streamdown-0.24.0}/tests/test.md +0 -0
  42. {streamdown-0.23.0 → streamdown-0.24.0}/tests/test_input.md +0 -0
  43. {streamdown-0.23.0 → streamdown-0.24.0}/tests/wm.md +0 -0
  44. {streamdown-0.23.0 → streamdown-0.24.0}/tools/deploy.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: streamdown
3
- Version: 0.23.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
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "streamdown"
7
- version = "0.23.0"
7
+ version = "0.24.0"
8
8
  description = "A streaming markdown renderer for modern terminals with syntax highlighting"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -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", '', highlighted_code)
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"):
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes