@hxii (Sorry, I know this isn't very helpful.)
@stephen Markdown parser creates the HTML, so I'd need to either ignore results between backticks (` or ```) or <code> blocks.
@hxii if you're already using markdown, why not use markdown-style links?
@stephen internal links for wiki, e.g. [[article title]]
@stephen PHP, so currently Parsedown parses the Markdown into HTML and then I use:
preg_match_all('/(?<!<code)\[\[([^\]\*)\]\](?!\<\/code>)/', $data, $internal_links, PREG_SET_ORDER);
But I still get weird matches.
@hxii indeed. I believe that's why the common wisdom is "don't parse html with regex."
@hxii Are you using a php framework, or is it a homegrown application?
@hxii Actually, if you're using Parsedown you may want to write an extension for it instead – that way you can deal with the data in the right domain. Implement your internal links there, rather than regex-ing the Parsedown output.
Merveilles is a community project aimed at the establishment of new ways of speaking, seeing and organizing information — A culture that seeks augmentation through the arts of engineering and design. A warm welcome to any like-minded people who feel these ideals resonate with them.