tgstation / tgstation

The /tg/station branch of SS13.
https://www.tgstation13.org/
GNU Affero General Public License v3.0
1.72k stars 4.75k forks source link

Paper markup: regex crash when using "_TEXT_" #80505

Open OverwatchVoice opened 10 months ago

OverwatchVoice commented 10 months ago

Issue Summary

Fairly self explanatory. Wrapping a text with underscores results in an NTOS crash.

Round ID: 22094

Testmerges:

00-Steven commented 8 months ago

from preliminary testing this seems to be any format of _text, not even full wrapping is needed to reproduce

00-Steven commented 8 months ago

notes: any number of underscores applies, if there is a space or any non-alphanumeric symbol it doesn't apply

00-Steven commented 8 months ago

incomprehensible thank you

FatalError: SyntaxError: Syntaxisfout in reguliere expressie
Please report this to https://github.com/markedjs/marked.
  at RegExp (core-js/modules/es.regexp.constructor.js:161)
  at emStrong (marked/lib/marked.esm.js:904)
  at _loop (marked/lib/marked.esm.js:1807)
  at inlineTokens
  at lex (marked/lib/marked.esm.js:1513)
  at lex (marked/lib/marked.esm.js:1491)
  at Anonymous function (marked/lib/marked.esm.js:2638)
  at marked (marked/lib/marked.esm.js:2657)
  at _this.runMarkedDefault (./tgui-workspace/packages/tgui/interfaces/PaperSheet.tsx:709)
  at _this.formatAndProcessRawText (./tgui-workspace/packages/tgui/interfaces/PaperSheet.tsx:729)

This feels related to https://github.com/markedjs/marked/issues/2339,