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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: check and apply markdown for smart picker output #5106

Merged
merged 1 commit into from Dec 28, 2023

Conversation

luka-nextcloud
Copy link
Contributor

馃摑 Summary

Always consider smart picker output as markdown.

馃毀 TODO

  • ...

馃弫 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

A few suggestions for detecting the markdown syntax (I know we can't cover everything there), but otherwise this seems fine and works well 馃憤

@mejo-
Copy link
Member

mejo- commented Dec 22, 2023

Maybe I'm missing something here, but why do we have to detect markdown manually at all, instead of just doing isValidMarkdown() and always sending the content through markdownit.render() if that succeeds?

@juliushaertl
Copy link
Member

Hm, unsure about that. It might be fine to just always pass it to markdown it indeed.

@luka-nextcloud
Copy link
Contributor Author

I have tried this way and faced an issue. The markdown-it render function always adds some newline character to content. So, If input value is an url, the inserted content will be a normal string instead of a link (enclose it in an angle brackets).

@luka-nextcloud luka-nextcloud force-pushed the feature/support-markdown-in-text-templates branch from b15266c to b7d3de0 Compare December 25, 2023 19:20
Signed-off-by: Luka Trovic <luka@nextcloud.com>
@luka-nextcloud luka-nextcloud force-pushed the feature/support-markdown-in-text-templates branch from b7d3de0 to cb4ad16 Compare December 26, 2023 05:35
@juliushaertl juliushaertl merged commit 114b2d4 into main Dec 28, 2023
38 checks passed
@juliushaertl juliushaertl deleted the feature/support-markdown-in-text-templates branch December 28, 2023 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Markdown in Text templates
3 participants