@tasksai/install 0.1.27 → 0.1.28
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.
- package/package.json +1 -1
- package/runtime/server.py +13 -5
package/package.json
CHANGED
package/runtime/server.py
CHANGED
|
@@ -125,7 +125,7 @@ if not LICENSE_KEY:
|
|
|
125
125
|
print("Find your key in your purchase confirmation email.", file=sys.stderr, flush=True)
|
|
126
126
|
sys.exit(1)
|
|
127
127
|
|
|
128
|
-
SERVER_VERSION = "2.4.
|
|
128
|
+
SERVER_VERSION = "2.4.4"
|
|
129
129
|
|
|
130
130
|
AUTH_HEADERS = {
|
|
131
131
|
"Authorization": f"Bearer {LICENSE_KEY}",
|
|
@@ -962,7 +962,7 @@ def iter_inline_markdown(text):
|
|
|
962
962
|
"""Yield (text, marks) spans for common inline Markdown."""
|
|
963
963
|
text = re.sub(r"\\([\\`*_{}\[\]()#+.!-])", r"\1", text)
|
|
964
964
|
token_re = re.compile(
|
|
965
|
-
r"(`[^`]+`|\*\*[^*]+\*\*|__[^_]
|
|
965
|
+
r"(`[^`]+`|\*\*[^*]+\*\*|(?<!_)__(?![_\s])[^_]+?(?<!\s)__(?!_)|\*[^*\s][^*]*\*|(?<!\w)_[^_\s][^_]*_(?!\w)|\[[^\]]+\]\([^)]+\))"
|
|
966
966
|
)
|
|
967
967
|
pos = 0
|
|
968
968
|
for match in token_re.finditer(text):
|
|
@@ -1052,6 +1052,14 @@ def add_markdown_text(paragraph, text):
|
|
|
1052
1052
|
run.font.name = "Courier New"
|
|
1053
1053
|
|
|
1054
1054
|
|
|
1055
|
+
def add_markdown_heading(doc, text, level):
|
|
1056
|
+
"""Create a Word heading while parsing any inline Markdown in its text."""
|
|
1057
|
+
|
|
1058
|
+
paragraph = doc.add_heading(level=level)
|
|
1059
|
+
add_markdown_text(paragraph, text)
|
|
1060
|
+
return paragraph
|
|
1061
|
+
|
|
1062
|
+
|
|
1055
1063
|
def add_horizontal_rule(paragraph):
|
|
1056
1064
|
"""Render a horizontal Markdown rule as a Word paragraph border."""
|
|
1057
1065
|
from docx.oxml import OxmlElement
|
|
@@ -1350,16 +1358,16 @@ def write_docx(path, title, content_markdown, product_name):
|
|
|
1350
1358
|
and re.sub(r"\W+", "", heading_text).casefold()
|
|
1351
1359
|
== re.sub(r"\W+", "", title).casefold()
|
|
1352
1360
|
):
|
|
1353
|
-
doc
|
|
1361
|
+
add_markdown_heading(doc, heading_text, min(len(heading.group(1)), 4))
|
|
1354
1362
|
keep_checklist_together = "checklist" in heading_text.casefold()
|
|
1355
1363
|
index += 1
|
|
1356
1364
|
elif standalone_bold_heading:
|
|
1357
1365
|
flush_paragraph()
|
|
1358
|
-
doc
|
|
1366
|
+
add_markdown_heading(doc, standalone_bold_heading.group(1).strip(), 3)
|
|
1359
1367
|
index += 1
|
|
1360
1368
|
elif inferred_heading:
|
|
1361
1369
|
flush_paragraph()
|
|
1362
|
-
doc
|
|
1370
|
+
add_markdown_heading(doc, stripped, inferred_heading)
|
|
1363
1371
|
keep_checklist_together = "checklist" in stripped.casefold()
|
|
1364
1372
|
index += 1
|
|
1365
1373
|
elif fact:
|