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

Add Rich Text matches #214

Closed
federico-terzi opened this issue Mar 26, 2020 · 5 comments
Closed

Add Rich Text matches #214

federico-terzi opened this issue Mar 26, 2020 · 5 comments
Labels
RFNR Ready to be shipped in next release

Comments

@federico-terzi
Copy link
Collaborator

Many users requested this feature, which would make espanso capable of expanding rich text (text with formatting, such as bold, center, italic, images).

A typical use case would be in email signatures.

@lyonsinbeta
Copy link

I don't know if you're interested in ideas around this, but if you are... I was thinking a "markdown" type might be a way to do this with plaintext YAML. Essentially, strings of type "markdown" could be processed before being inserted. Making markdown a type prevents every string from being needlessly processed too.

Mocked up example:

espanso-markdown

@pseudomichael
Copy link

I second a request for Markdown processing support for rich text!

@federico-terzi
Copy link
Collaborator Author

@lyonsinbeta @pseudomichael I was thinking about HTML, but indeed markdown would be better for the user. We'll probably end up supporting both, as we need to copy HTML content in the clipboard, so we need a markdown to HTML compiler for Rust (which luckily, seems to exist: https://github.com/johannhof/markdown.rs)

Given the interest, I'll move this issue up in priority, so that hopefully we get a POC in the next release :)

@federico-terzi
Copy link
Collaborator Author

Experimental support coming in the next release!

richtext2

You'll be able to specify the rich text both as markdown and HTML as you suggested:

  - trigger: ":rich"
    markdown: "This *text* is **very rich**!"
  
  - trigger: ":ric2"
    html: '<p>But <span style="color: #ce181e;"><span style="font-size: x-large;">this</span></span> one is <span style="color: #81d41a;"><span style="font-family: Arial, sans-serif;">even richer</span></span>!</p>'

Cheers :)

@federico-terzi federico-terzi added the RFNR Ready to be shipped in next release label Oct 23, 2020
@federico-terzi
Copy link
Collaborator Author

This has been fixed in the new release! See: https://github.com/federico-terzi/espanso/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFNR Ready to be shipped in next release
Projects
None yet
Development

No branches or pull requests

3 participants