Skip to content
Snippets Groups Projects
Commit 93dc3f12 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow punctuation characters on either side of the markup tags

So you can do stuff (*like this*).

Also, we don't need to heavily scrutinize the closing tag when we come upon it because we already determined it was valid before we accepted the opening tag/character.
parent a6bf9ea1
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #483 passed
......@@ -165,9 +165,10 @@ char sbbs_t::putmsgfrag(const char* buf, long* mode, long org_cols, JSObject* ob
if(mark == 0)
next = strchr(str + l + 1, str[l]);
char *blank = strstr(str + l + 1, "\n\r");
if(((l < 1 || isspace(str[l - 1]))
&& isalnum(str[l + 1]) && mark == 0 && next != NULL && (*(next + 1) == '\0' || isspace(*(next + 1))) && (blank == NULL || next < blank))
|| (l > 0 && (isalnum(str[l - 1]) || ispunct(str[l - 1])) && str[l] == mark)) {
if(((l < 1 || isspace(str[l - 1]) || ispunct(str[l - 1]))
&& isalnum(str[l + 1]) && mark == 0 && next != NULL && (*(next + 1) == '\0' || isspace(*(next + 1)) || ispunct(*(next+1)))
&& (blank == NULL || next < blank))
|| str[l] == mark) {
if(mark == 0)
mark = str[l];
else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment