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

Markdown Here Revival and SmartTemplates #341

Open
infinitelyintrigued opened this issue Nov 28, 2024 · 4 comments
Open

Markdown Here Revival and SmartTemplates #341

infinitelyintrigued opened this issue Nov 28, 2024 · 4 comments
Labels

Comments

@infinitelyintrigued
Copy link

Recently, I've started experimenting with this add-on:

It's useful when I need to include a program code, for example.

I have this line in a SmartTemplates template:

Hi, %recipient(addressbook,nickname,??firstname)%,

When this line is rendered by Markdown Here Revival, it becomes:

Hi,
George
,

I'm looking for a workaround. For example, is there a function to concatenate strings like a join function to join "Hi, ", %recipient(addressbook,nickname,??firstname)%, and ","?

Thank you,

--

  • Thunderbird: 128.5.0esr (64-bit)
  • SmartTemplates: 4.9
  • Markdown Here Revival 4.0.2
@RealRaven2000
Copy link
Owner

Just looked at the ATN version and I am afraid I probably won't have time on working on fully integrating that. If I understand it correctly you edit Markdown on a separate screen and then insert it somewhere in the email (after SmartTemplates has already run) ?

@infinitelyintrigued
Copy link
Author

The Markdown add-on lets me edit directly in the compose window. It renders as I type texts and Markdown codes. The issue I reported only happens to Write templates. Reply templates work as expected.

I think I found a workaround:

  1. Click New Message to open a new compose window. (A SmartTemplates Write templates is invoked.)
  2. Enter the recipient's email address in the To field. Click the recipient's name placeholder in the message body to resolve the name. At this point, Markdown renders the "Dear ...," line as broken lines.
  3. Switch to a different Write template by choosing a different profile and then switch back to the original profile. These actions seem to force the Markdown to re-render. This re-rendering fixes the issue.

Since I reply more than compose new messages, I think I'm OK with this workaround for now. Thank you for looking into this issue. Have a good Thanksgiving!

@RealRaven2000
Copy link
Owner

3. Switch to a different Write template by choosing a different profile and then switch back to the original profile. These actions seem to force the Markdown to re-render. This re-rendering fixes the issue.

ok - but doesn't switching bring up a warning / or reset whatever you have entered so far? I guess that Markdown does some processing after SmartTemplates did the cursor positioning... internally it just adds a hidden <span> element which it then replaces with a space that it selects with the cursor as very last step.

@infinitelyintrigued
Copy link
Author

Yes, it does reset, but the "Dear ..." part is the same between my two profile Write templates. After I complete the "Dear ..." part and switch immediately, the "Dear .. " part is preserved.

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

No branches or pull requests

2 participants