Skip to content

Attributes containing " cannot be parsed, even when escaped with \ #119

@faytecCD

Description

@faytecCD

Description

When using tag attributes, for example when the value of the name attribute contains a double quote ("), parsing fails even if the quote is escaped with a backslash (\) (added via addslashes).

This makes it impossible to use usernames or display names that contain double quotes.

Reproduction

[mention id=1 name="foo\"ff\""][/mention]

Expected Behavior

The value of name should be parsed as:

foo"ff"

Actual Behavior

Parsing fails and the original text is returned unchanged.

Impact

  • Double quotes cannot be safely used inside attribute values

Notes

  • Escaping with \" has already been tried
  • The only possible workaround seems to be adjusting TOKEN_DELIMITER
  • I am using RegularParser

Workaround

  • Use content instead of an attribute
[mention id=1]foo"ff"[/mention]

This currently works.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions