Is it possible to have a live hyperlink *inside* a \`\`\`Code Block\`\`\`? Something like: ```markdown This code block contains an embedded [hyperlink](http://en.wikipedia.org/wiki/Hyperlink). Is it possible to render it as an active link instead of source? ``` I realize that Markdown support already exists, but it doesn't work. And, I also realize that what I'm asking for is diametrically opposed to what a Code Block is meant to be (even one with syntax highlighting. It's a "WYSIWYG" functionality, and I'm trying to circumvent it (at least partially). Is there a way?
Fenced code block is not in vanilla Markdown. "kramdown" can let you write this way: <pre markdown="1" class="lang-markdown"> This code block contains an embedded [hyperlink](http://en.wikipedia.org/wiki/Hyperlink). </pre> It is really unusual to have links inside code block (which should be kept as is). So you'd better use raw HTML code instead of mixing them up. <pre class="lang-markdown"> This code block contains an embedded <a href="http://en.wikipedia.org/wiki/Hyperlink">hyperlink</a>. </pre> On 2014-03-27, at 01:25+08:00, Tom Maynard <tom at maynard.com> wrote:> Is it possible to have a live hyperlink *inside* a \`\`\`Code Block\`\`\`? Something like: > ```markdown > This code block contains an embedded [hyperlink](http://en.wikipedia.org/wiki/Hyperlink). Is it possible to render it as an active link instead of source? > ``` > I realize that Markdown support already exists, but it doesn't work. And, I also realize that what I'm asking for is diametrically opposed to what a Code Block is meant to be (even one with syntax highlighting. It's a "WYSIWYG" functionality, and I'm trying to circumvent it (at least partially). > > Is there a way? > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss
This will never be a feature, as half the point of a code block, in Markdown, is to opt out of Markdown syntax recognition. I would agree, this is a job for HTML (or, perhaps, a post-Markdown linkifying script, depending on your use case). Alan> Le Mar 26, 2014 ? 10:25 AM, Tom Maynard <tom at maynard.com> a ?crit : > > Is it possible to have a live hyperlink *inside* a \`\`\`Code Block\`\`\`? Something like: > ```markdown > This code block contains an embedded [hyperlink](http://en.wikipedia.org/wiki/Hyperlink). Is it possible to render it as an active link instead of source? > ``` > I realize that Markdown support already exists, but it doesn't work. And, I also realize that what I'm asking for is diametrically opposed to what a Code Block is meant to be (even one with syntax highlighting. It's a "WYSIWYG" functionality, and I'm trying to circumvent it (at least partially). > > Is there a way? > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss
Considering that one of the features of Code Blocks is that they can be used to display markdown syntax in its original source, the answer would be no. There is no way to have markdown syntax interpreted inside a code block. This would be one of those things that you would need to do with raw HTML as others have already demonstrated. Waylan On Wednesday, March 26, 2014, Tom Maynard <tom at maynard.com> wrote:> Is it possible to have a live hyperlink *inside* a \`\`\`Code Block\`\`\`? > Something like: > ```markdown > This code block contains an embedded [hyperlink](http://en. > wikipedia.org/wiki/Hyperlink). Is it possible to render it as an active > link instead of source? > ``` > I realize that Markdown support already exists, but it doesn't work. And, > I also realize that what I'm asking for is diametrically opposed to what a > Code Block is meant to be (even one with syntax highlighting. It's a > "WYSIWYG" functionality, and I'm trying to circumvent it (at least > partially). > > Is there a way? > > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss >-- Waylan Limberg -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20140326/fcad8a3f/attachment.htm>