Still HTML-escape chunks if Adventure is off

(cherry picked from commit 3409d8c12e3fbb1e3232f2df82740b012e8f3604)
This commit is contained in:
Gnome Ann 2021-08-19 11:06:39 -04:00
parent 09030573e5
commit 735fc9431b
1 changed files with 2 additions and 1 deletions

View File

@ -1316,8 +1316,9 @@ def applyoutputformatting(txt):
def refresh_story(): def refresh_story():
text_parts = ['<chunk n="0" id="n0">', html.escape(vars.prompt), '</chunk>'] text_parts = ['<chunk n="0" id="n0">', html.escape(vars.prompt), '</chunk>']
for idx, item in enumerate(vars.actions, start=1): for idx, item in enumerate(vars.actions, start=1):
item = html.escape(item)
if vars.adventure: # Add special formatting to adventure actions if vars.adventure: # Add special formatting to adventure actions
item = vars.acregex_ui.sub('<action>\\1</action>', html.escape(item)) item = vars.acregex_ui.sub('<action>\\1</action>', item)
text_parts.extend(('<chunk n="', str(idx), '" id="n', str(idx), '">', item, '</chunk>')) text_parts.extend(('<chunk n="', str(idx), '" id="n', str(idx), '">', item, '</chunk>'))
emit('from_server', {'cmd': 'updatescreen', 'gamestarted': vars.gamestarted, 'data': formatforhtml(''.join(text_parts))}, broadcast=True) emit('from_server', {'cmd': 'updatescreen', 'gamestarted': vars.gamestarted, 'data': formatforhtml(''.join(text_parts))}, broadcast=True)