Skip to content

WIP: Fix inline spoilers when using toolbar Blur Spoiler #31791

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martin-brennan
Copy link
Contributor

When we do applySurround, if we have an active ProseMirror
selection via this.view.state.selection, then we should not use
the "example text" when attempting to add [spoiler] bbcode.

In addition to this, when we call convertFromMarkdown we must
add an additional bit of text at the beginning otherwise the
parser will always parse e.g. [spoiler]test[/spoiler] as
a spoiler block bbcode rather than inline bbcode

} else {
// NOTE: We need to add IGNORE here otherwise the convertFromMarkdown
// markdown parser will parse the text as a block instead of inline.
text =
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really not ideal and probably breaks other stuff...I just have no idea how to get prosemirror-markdown to parse as inline bbcode for e.g. [spoiler]test[/spoiler], it only figures out it's inline with something before or after the spoiler tags

When we do `applySurround`, if we have an active ProseMirror
selection via this.view.state.selection, then we should not use
the "example text" when attempting to add [spoiler] bbcode.

In addition to this, when we call `convertFromMarkdown` we must
add an additional bit of text at the beginning otherwise the
parser will always parse e.g. `[spoiler]test[/spoiler]` as
a spoiler block bbcode rather than inline bbcode
@martin-brennan martin-brennan force-pushed the issue/inline-spoiler-prosemirror branch from b9e5977 to 6841e5e Compare March 13, 2025 07:00
@martin-brennan martin-brennan requested a review from renato March 25, 2025 05:04
Copy link

This pull request has been automatically marked as stale because it has been open for 60 days with no activity. To keep it open, remove the stale tag, push code, or add a comment. Otherwise, it will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

1 participant