entari-plugin-hyw 3.2.106__tar.gz → 3.2.107__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.

Potentially problematic release.


This version of entari-plugin-hyw might be problematic. Click here for more details.

Files changed (53) hide show
  1. {entari_plugin_hyw-3.2.106/src/entari_plugin_hyw.egg-info → entari_plugin_hyw-3.2.107}/PKG-INFO +1 -1
  2. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/pyproject.toml +1 -1
  3. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/render.py +38 -2
  4. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107/src/entari_plugin_hyw.egg-info}/PKG-INFO +1 -1
  5. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/MANIFEST.in +0 -0
  6. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/README.md +0 -0
  7. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/setup.cfg +0 -0
  8. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/__init__.py +0 -0
  9. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/anthropic.svg +0 -0
  10. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/deepseek.png +0 -0
  11. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/gemini.svg +0 -0
  12. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/google.svg +0 -0
  13. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/grok.png +0 -0
  14. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/microsoft.svg +0 -0
  15. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/minimax.png +0 -0
  16. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/mistral.png +0 -0
  17. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/nvida.png +0 -0
  18. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/openai.svg +0 -0
  19. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/openrouter.png +0 -0
  20. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/perplexity.svg +0 -0
  21. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/qwen.png +0 -0
  22. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/xai.png +0 -0
  23. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/icon/zai.png +0 -0
  24. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/highlight.css +0 -0
  25. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/highlight.js +0 -0
  26. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/katex-auto-render.js +0 -0
  27. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/katex.css +0 -0
  28. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/katex.js +0 -0
  29. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/libs/tailwind.css +0 -0
  30. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/package-lock.json +0 -0
  31. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/package.json +0 -0
  32. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/tailwind.config.js +0 -0
  33. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/tailwind.input.css +0 -0
  34. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/template.html +0 -0
  35. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/template.html.bak +0 -0
  36. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/assets/template.j2 +0 -0
  37. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/__init__.py +0 -0
  38. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/config.py +0 -0
  39. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/history.py +0 -0
  40. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/hyw.py +0 -0
  41. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/pipeline.py +0 -0
  42. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/core/render.py.bak +0 -0
  43. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/__init__.py +0 -0
  44. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/browser.py +0 -0
  45. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/mcp_playwright.py +0 -0
  46. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/misc.py +0 -0
  47. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/playwright_tool.py +0 -0
  48. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/prompts.py +0 -0
  49. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw/utils/search.py +0 -0
  50. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw.egg-info/SOURCES.txt +0 -0
  51. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw.egg-info/dependency_links.txt +0 -0
  52. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw.egg-info/requires.txt +0 -0
  53. {entari_plugin_hyw-3.2.106 → entari_plugin_hyw-3.2.107}/src/entari_plugin_hyw.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entari_plugin_hyw
3
- Version: 3.2.106
3
+ Version: 3.2.107
4
4
  Summary: Use large language models to interpret chat messages
5
5
  Author-email: kumoSleeping <zjr2992@outlook.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "entari_plugin_hyw"
7
- version = "3.2.106"
7
+ version = "3.2.107"
8
8
  description = "Use large language models to interpret chat messages"
9
9
  authors = [{name = "kumoSleeping", email = "zjr2992@outlook.com"}]
10
10
  dependencies = [
@@ -178,12 +178,48 @@ class ContentRenderer:
178
178
  last_exc = None
179
179
  for attempt in range(1, max_attempts + 1):
180
180
  try:
181
- # Server-side Markdown Rendering
181
+ # 1. Protect math blocks
182
+ # We look for $$...$$, \[...\], \(...\)
183
+ # We'll replace them with placeholders so markdown extensions (like nl2br) don't touch them.
184
+ math_blocks = {}
185
+
186
+ def protect_math(match):
187
+ key = f"__MATH_BLOCK_{len(math_blocks)}__"
188
+ math_blocks[key] = match.group(0)
189
+ return key
190
+
191
+ # Patterns for math:
192
+ # 1) $$ ... $$ (display math)
193
+ # 2) \[ ... \] (display math)
194
+ # 3) \( ... \) (inline math)
195
+ # Note: We must handle multiline for $$ and \[
196
+
197
+ # Regex for $$...$$
198
+ markdown_content = re.sub(r'\$\$(.*?)\$\$\s*', protect_math, markdown_content, flags=re.DOTALL)
199
+
200
+ # Regex for \[...\]
201
+ markdown_content = re.sub(r'\\\[(.*?)\\\]\s*', protect_math, markdown_content, flags=re.DOTALL)
202
+
203
+ # Regex for \(...\) (usually single line, but DOTALL is safest if user wraps lines)
204
+ markdown_content = re.sub(r'\\\((.*?)\\\)', protect_math, markdown_content, flags=re.DOTALL)
205
+
206
+ # 2. Render Markdown
207
+ # Use 'nl2br' to turn newlines into <br>, 'fenced_code' for code blocks
182
208
  content_html = markdown.markdown(
183
- markdown_content.strip(),
209
+ markdown_content.strip(),
184
210
  extensions=['fenced_code', 'tables', 'nl2br', 'sane_lists']
185
211
  )
186
212
 
213
+ # 3. Restore math blocks
214
+ def restore_math(text):
215
+ # We assume placeholders are intact. We do a simple string replace or regex.
216
+ # Since placeholders are unique strings, we can just replace them.
217
+ for key, val in math_blocks.items():
218
+ text = text.replace(key, val)
219
+ return text
220
+
221
+ content_html = restore_math(content_html)
222
+
187
223
  # Post-process to style citation markers
188
224
  parts = re.split(r'(<code.*?>.*?</code>)', content_html, flags=re.DOTALL)
189
225
  for i, part in enumerate(parts):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: entari_plugin_hyw
3
- Version: 3.2.106
3
+ Version: 3.2.107
4
4
  Summary: Use large language models to interpret chat messages
5
5
  Author-email: kumoSleeping <zjr2992@outlook.com>
6
6
  License: MIT