8000 Basic spoiler markdown plugin by ginnyTheCat · Pull Request #267 · cinnyapp/cinny · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Basic spoiler markdown plugin #267

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

Merged
merged 2 commits into from
Jan 31, 2022
Merged

Basic spoiler markdown plugin #267

merged 2 commits into from
Jan 31, 2022

Conversation

ginnyTheCat
Copy link
Contributor
@ginnyTheCat ginnyTheCat commented Jan 28, 2022

Description

This change adds a custom micromark extension allowing the use of discord-style markdown spoilers. In case a different style of spoilers is preferred I would have no problem adapting the extension to these new tasks.

Sending snape kills ||somebody|| with markdown mode enabled will result in snape kills <span data-mx-spoiler>somebody</span> being sent.

image

The feature is not fully complete yet as the extension code is still very messy and the parser might mess things up in some edge cases. Hiding the spoiler message in the plaintext body is missing as well (it's in the spec; element android/web doesn't do it).

Fixes #177

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Preview: https://61f411375d675fed5078a1a7--pr-cinny.netlify.app
⚠️ Do you trust the author of this PR? Maybe this build will steal your keys or give you malware. Exercise caution. Use test accounts.

@ajbura
Copy link
Member
ajbura commented Jan 28, 2022

IMHO we should add spoiler support (and possibly bold, italics, and more text formatting options) with a custom input (aka editor like slack). So my plan was to work on this by making a Custom Message Input and leverage it for spoilers too.

Though I have no issues having this as a temporary solution and wouldn’t recommend building something complex on it.

@ginnyTheCat
Copy link
Contributor Author

Sounds great! Just curious if the editor would have an option to still use markdown (like GitHub does it) or if it would be completely hidden from the user?
As a temporary solution it's probably already good enough.

@ginnyTheCat ginnyTheCat marked this pull request as ready for review January 28, 2022 15:50
@ajbura
Copy link
Member
ajbura commented Jan 29, 2022

Just curious if the editor would have an option to still use markdown (like GitHub does it) or if it would be completely hidden from the user?

Haven't thought much but it probably will be mix of both, so markdown still be visible but user pills, room alias etc will not.

Copy link
Member
@ajbura ajbura left a comment

Choose a reason for hiding this comment

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

Looks good.

@ajbura
Copy link
Member
ajbura commented Jan 31, 2022

Could you rebase it with latest commits in dev?

@ajbura ajbura merged commit 0e8219b into cinnyapp:dev Jan 31, 2022
@ginnyTheCat ginnyTheCat deleted the md-spoiler branch February 13, 2022 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

spoiler creation support
2 participants
0