@tasksai/install 0.1.25 → 0.1.26
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 -1
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.2"
|
|
129
129
|
|
|
130
130
|
AUTH_HEADERS = {
|
|
131
131
|
"Authorization": f"Bearer {LICENSE_KEY}",
|
|
@@ -907,6 +907,8 @@ def inferred_plain_heading_level(lines, index):
|
|
|
907
907
|
text = lines[index].strip()
|
|
908
908
|
if not text or len(text) > 90 or "|" in text or ":" in text:
|
|
909
909
|
return None
|
|
910
|
+
if re.match(r"^(?:[-*+]\s+|\d+\.\s+|>|<!--)", text):
|
|
911
|
+
return None
|
|
910
912
|
if text.endswith((".", "?", "!", ";")):
|
|
911
913
|
return None
|
|
912
914
|
|
|
@@ -930,6 +932,9 @@ def inferred_plain_heading_level(lines, index):
|
|
|
930
932
|
|
|
931
933
|
def labeled_fact(line):
|
|
932
934
|
"""Return a label/value pair for a short professional fact line."""
|
|
935
|
+
bold_match = re.match(r"^\*\*([^*\n:]{1,55}):\*\*\s+(.+)$", line.strip())
|
|
936
|
+
if bold_match:
|
|
937
|
+
return bold_match.group(1).strip(), bold_match.group(2).strip()
|
|
933
938
|
match = re.match(r"^([^:\n]{1,55}):\s+(.+)$", line.strip())
|
|
934
939
|
if not match:
|
|
935
940
|
return None
|
|
@@ -1141,6 +1146,13 @@ def add_markdown_table(doc, rows, alignments):
|
|
|
1141
1146
|
table.autofit = True
|
|
1142
1147
|
repeat_table_header(table.rows[0])
|
|
1143
1148
|
for row_index, row in enumerate(normalized):
|
|
1149
|
+
row_characters = sum(len(value) for value in row)
|
|
1150
|
+
longest_cell = max((len(value) for value in row), default=0)
|
|
1151
|
+
if row_index == 0 or (row_characters <= 600 and longest_cell <= 350):
|
|
1152
|
+
# Keep ordinary rows intact so a cell does not strand a fragment
|
|
1153
|
+
# on the next page. Exceptionally large rows may still split to
|
|
1154
|
+
# avoid creating a mostly blank page.
|
|
1155
|
+
prevent_table_row_split(table.rows[row_index])
|
|
1144
1156
|
for column_index, value in enumerate(row):
|
|
1145
1157
|
cell = table.cell(row_index, column_index)
|
|
1146
1158
|
set_cell_margins(cell)
|