Hi there everyone.
I’m currently working on an improved version of this site but I’m facing a weird issue.
On the site there’s an interview section where I use divs to wrap the questions and answers.
In the old version (the one currently online) I used two custom tags (q: )
and (a: )
and everything was working almost fine except for the fact that we couldn’t use links inside the kirbytag. That seems to be a known issue though.
So to avoid that problem I decided to try a different solution.
I’m currently marking the beginning and end of each question and answer with two markers, something like this:
q: This is the actual text. :q
And I’m then using a pre filter to swap those markers with div tags.
The pre filter looks like this
// Pre filter to include the q and a blocks
kirbytext::$pre[] = function($kirbytext, $value) {
$value = preg_replace('/^(q:\s?)/m', "<div class='q'>", $value);
$value = preg_replace('/(\s?:q)/m', "</div>", $value);
$value = preg_replace('/(\s?:a)/m', "</div>", $value);
$value = preg_replace('/^(a:\s?)/m', "<div class='a'>", $value);
// Return the content
return $value;
};
Up to this point, everything works correctly, the divs are in place, I can use kirbytags inside the text which si awesome but I noticed that the markdown is no longer parsed.
Is there a known reason why this is happening?
Thanks