Closed tomaszstrojny closed 3 years ago
anyway you could include a screenshot or gif showing me the issue? it's been a long time since I really used kanboard so not sure I even know what you're talking about. point me in the right direction.
Sure! Thanks for the response :)
For the code I've pasted above I am getting such a content:
When I comment the $text = $parser->text($text);
and uncomment the // $text = $parsecheckbox->text($text);
I'm getting something like this:
As you can see, the checkbox is rendered correctly, but the links under @admin
and #1
disappeared.
OK, I understand now.
and what's the non preview of that link code look like?
is it markdown or html? or does it just link with #1
oh and the @
nm I see it autofills... I'll take a look, probably some js stuff goin on with that, I wasn't even aware of it.
From what I observe, it's in PHP.
The methods meant to build the internal link and users (defined in the Core/Kanboard
) are not run when we use the checkbox parser. I'm tracing the execution with xdebug and it just doesn't run it. It's like the Core/Markdown
parser runs or the ParsedownCheckbox
- I cannot get both of them working on the same content.
OK, I understand now.
and what's the non preview of that link code look like?
is it markdown or html? or does it just link with
#1
oh and the@
Generally in Kanboard internal links are created by the core parser, which looks for @ and #, give suggestions and then parse them as links. @mentions to users and #123 to tasks.
For the not parsed version HTML looks like that:
<article class="markdown">
<p>test @admin <img class="emojione" alt="↕" title=":arrow_up_down:" src="https://cdn.jsdelivr.net/emojione/assets/4.5/png/32/2195.png"> #1 </p>
<input type="checkbox" disabled=""> ates
</article>
on the other hand we have this:
<article class="markdown">
<p>test <a href="/?controller=UserViewController&action=profile&user_id=1" class="user-mention-link" title="admin" aria-label="admin">@admin</a> <img class="emojione" alt="↕" title=":arrow_up_down:" src="https://cdn.jsdelivr.net/emojione/assets/4.5/png/32/2195.png"> <a href="/?controller=TaskViewController&action=show&task_id=1">#1</a>
</p>
<p>[ ] ates</p>
</article>
see, you know more than I do! I'll definitely take a look and see what I can come up with, might just take me a while to get the chance though. if I'm lucky, you solve it before me 😄
i figured out whats going on. had to come up with a workaround, but long story short, the core markdown extends Parsedown, i had to back it out and extend ParsedownCheckbox, which extends Parsedown extra, and then add to the construct to get it to run them all.
@tomaszstrojny givee it a test drive, hopefully i didn't screw anything up fixing it
well, now i'm getting an error, and I'm out of time for the day. to be continued:
2021/03/15 15:21:41 [error] 16#16: *202 FastCGI sent in stderr: "PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/app/plugins/MarkdownPlus/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 241PHP message: PHP Notice: Trying to access array offset on value of type null in /var/www/app/plugins/MarkdownPlus/vendor/erusev/parsedown-extra/ParsedownExtra.php on line 241" while reading response header from upstream, client: 172.17.0.3, server: localhost, request: "GET /project/4/task/110 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm.sock:", host: "projects.divdist.com"
@tomaszstrojny ok, so no errors, and all appears to correctly be parsing...let me know if you see anymore issues.
reopen if you find any issues, closing for now.
Changes in the vendor directory is always a lot of fun :)
Anyway, everything works nice now, thanks!
I know, I hated to do it, but really had no choice.
After installing the plugin, all the comments and descriptions are cleared from the internal links and @mentions.
I've tracked down it's because of the
ParsedownCheckbox
, emojis work fine.My current code for the
MarkdownPlusHelper->markdown()
looks like this, and it works:While I try to add the
parsecheckbox
in any other place, it's escaping the links. It generally makes sense, but I would like to have both of them and don't know how to touch it. Do you have any suggestions?