чување 3a7ed4b30275ced0cfff49fefa1648a3415e3e82
родитељ 0b7833d329bf9ef709c768865bd4b8ddb44bc3ec
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Mon, 10 Apr 2023 07:29:55 +0200
Fix: Test for numbered list item from the beginning of line instead of testing token
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 1, додавања: 4(+), брисања: 5(-)
diff --git a/slweb.c b/slweb.c
@@ -211,10 +211,10 @@ endswith(const char* s, const char* what)
}
int
-all_numeric(const u8* s)
+all_numeric(const u8* start, const u8* end)
{
- const u8* ps = s;
- while (*ps)
+ const u8* ps = start;
+ while (ps != end)
{
if (*ps && !isdigit((const int)*ps))
return 0;
@@ -4545,7 +4545,6 @@ do_line:
case '8':
case '9':
case '0':
- *ptoken = 0;
if (ANY(state,
ST_CODE | ST_DISPLAY_FORMULA | ST_FORMULA
| ST_MACRO_BODY | ST_PRE | ST_YAML_VAL))
@@ -4553,7 +4552,7 @@ do_line:
CHECKCOPY(token, ptoken, token_size, pline);
colno++;
}
- else if ((colno == 1 || all_numeric(token))
+ else if ((colno == 1 || all_numeric(line, pline))
&& strlen((char*)pline) > 1
&& (*(pline + 1) == '.' || *(pline + 1) == ')'))
{