wheelmaker24 Posted March 11, 2016 Share Posted March 11, 2016 Hi, just a quick question: I want to add the following text to the note field of a template field: To add a link insert [Title](http://www.your.url) to your text. Unfortunately this is parsed automatically and it shows something like this: To add a link insert Title to your text. I tried escaping the Markdown code with backslashes, but this didn't lead to the expected result. Any ideas? Thanks! Nik Link to comment Share on other sites More sharing options...
Jan Romero Posted March 11, 2016 Share Posted March 11, 2016 I use a zero-width space word joiner character to destroy the markdown: [Link-Beschreibung](http://www.beispiel.de) This will prevent users from copying it from the field description, though… 4 Link to comment Share on other sites More sharing options...
nikosch Posted March 11, 2016 Share Posted March 11, 2016 Escaping? https://daringfireball.net/projects/markdown/syntax#backslash Or do I get the question wrong? Link to comment Share on other sites More sharing options...
wheelmaker24 Posted March 13, 2016 Author Share Posted March 13, 2016 Hi nikosch, I've tried escaping with backslashes, but this does not seem to work: To add a link insert \[Title\]\(http://www.your.url\) to your text. Jan's solution is working, although as he said copying the phrase is not possible for authors then. Link to comment Share on other sites More sharing options...
LostKobrakai Posted March 13, 2016 Share Posted March 13, 2016 Ryan is not using a markdown parser for field descriptions/notes as they're only supporting a small subset of markdown (I think links/bold/italic and that's it) and it's faster this way, but that's probably the reason, why escaping doesn't work. 1 Link to comment Share on other sites More sharing options...
wheelmaker24 Posted March 13, 2016 Author Share Posted March 13, 2016 I see! I'll keep it with Jan's solution then ;-) Thanks, everybody! Link to comment Share on other sites More sharing options...
Robin S Posted June 3, 2022 Share Posted June 3, 2022 An old topic but I just hit this problem too, where I want to give an example of Markdown format in the field description without that actually being converted into HTML. I solved it by setting the Inputfield textFormat property in a hook: // Avoid Markdown in description/notes being converted into HTML // Adjust as needed for your Inputfield type and field name $wire->addHookAfter('InputfieldTextarea::renderReadyHook', function(HookEvent $event) { /** @var InputfieldTextarea $inputfield */ $inputfield = $event->object; if($inputfield->name === 'my_field_name') { $inputfield->textFormat = Inputfield::textFormatNone; } }); 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now