Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to escape bbcode tags? #16

Closed
davidferguson opened this issue Jun 16, 2019 · 2 comments · Fixed by #17
Closed

Any way to escape bbcode tags? #16

davidferguson opened this issue Jun 16, 2019 · 2 comments · Fixed by #17
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@davidferguson
Copy link
Contributor

Is there a way to escape a bbcode tag, with for example a backslash? Say for example I have the following BBCode:

This is [b]a test[/b] of \[b\]escaping\[/b\] bbcode, I would want the parser to produce something like the following tree:

[
  "This",
  " ",
  "is",
  " ",
  {
    "tag": "b",
    "attrs": {},
    "content": [
      "a",
      " ",
      "test"
    ]
  },
  "of",
  " ",
  "[b]escaping[/b]",
  " ",
  "bbcode"
]

Is this possible?

@JiLiZART
Copy link
Owner

Hi! Now it's not possible, but it's not so really hard to implement.

@JiLiZART JiLiZART added this to the v2.5.0 milestone Jun 16, 2019
@JiLiZART JiLiZART added the enhancement New feature or request label Jun 16, 2019
@JiLiZART JiLiZART self-assigned this Jun 16, 2019
@davidferguson
Copy link
Contributor Author

You'll see I've submitted a PR with a working implementation and tests for this. It introduces an option enableEscapeTags which when set, enables the escaping of tags via a backslash. Therefore there is no change in behaviour when this option is not supplied, making it fully backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants