mantisbt-plugins/BBCodePlus

@Mentioning view not correct

Closed this issue · 21 comments

When I want to notify someone with @ (@username), I
see the (not clickable) uri of the user:
https://bugtracker.host.nl/view_user_page.php?id=44

instead of @username

MantisBT 2.21.0
BBCode+ 2.1.3
PHP version 7.1.18

2019-04-23 19_26_26-Window

Bumping into this issue because I have te same issue here.
Looking for a solution quite a while now so help would be very much appreciated.

A new set of changes has been merged into the master. Please download master and check for correction of this issue with feedback.

Found a bug with the mentioning link related to the regex. Working to resolve.

Corrected the issue. Will await for a few days for further feedback before closing the issue.

@bkraul
This issue seems to be fixed with version 2.1.6
Thanks

I still have the problem with bug links of resolved bugs (bug_resolved_status_threshold <= bug status ) it shows /support/view.php?id=5000 in plain text instead of the link. Mantis 2.21.0 + BBcode plus vers 2.1.6

I am not sure I am understanding. Could you please post a screenshot of what your referenced bug looks like? I have marked a bug as resolved, and then referenced it with #[ID] in another bug, and the link showed correctly.

Do you have MantisCoreFormatting plugin disabled? Latest changes to the BBCodePlus plugin no longer try to generate bug links. Which means that if you want that functionality, you must enable the MantisCoreFormatting plugin, which is the one that provides it.

I can't send a screen right now but I will send it tomorow. I do have MantisCoreFormatting plugin enabled since comment link ~[comment_id] and buglink on non-resolved Mantis works. Bug links for resolved bugs are displayed differently (they are striked) and the bug might come from that.
I temporarily solved this by displaying resolved bugs link like other bugs link (i.e not striked) in core/string_api.php. I will also send a screenshot of this tomorow.

Yeah, please do. That way I will be able to replicate and fix if possible.

@AmauryBs I was able to replicate your issue. There is no need to send me a screenshot. I will look at the problem and attempt to resolve.

image

@AmauryBs please confirm correction of behavior by downloading the latest master or release (2.1.7).

@bkraul the fix worked in some way but broked all the bbcode tags and the display of text in the whole site ( the screenshots bellow show Mantis before and after the fix)
before_plugin
bug_bbcode_plugin
bug_link
expected view
my view

ok i found what it was, you forgot to remove a echo at line 297 in BBCodePlus.php. It seems to work fine without it, I will test it a bit more and tell you if I find anything else. Thanks for this quick fix btw

Ah crap. You are right. Will remove that asap.

It is done. v2.1.8 is available.

Mentioning people with "@" and links to other tickets via # and ~ are working with v2.1.8.
What's still not working are hyperlinks. When I disable the plugin the hyperlinks work.
I attached screenshots of all relevant options. If something is missing let me know.

bbcode

format

ticket

That is due to the an interaction of automatic link creation and the BBCode implementation. This is an unavoidable behavior. Take for instance:

you have [img]https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fs7d2.scene7.com%2Fis%2Fimage%2FPetSmart%2FARTHMB-HowToHelpYourCatHaveFewerHairballs-20160818%3F%24AR1104%24&f=1[/img], which is supposed to generate an image like:

image

If automatic link generation is applied, what you will end up with the following markup:

<img src="<a target=" _blank"="" href="https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fs7d2.scene7.com%2Fis%2Fimage%2FPetSmart%2FARTHMB-HowToHelpYourCatHaveFewerHairballs-20160818%3F%24AR1104%24&amp;f=1[/img">]https://proxy.duckduckgo.com/iu/?u=http%3A%2F%2Fs7d2.scene7.com%2Fis%2Fimage%2FPetSmart%2FARTHMB-HowToHelpYourCatHaveFewerHairballs-20160818%3F%24AR1104%24&amp;f=1"&gt;

Which would obviously break image display.

This is the line that prevents it:

Therefore, in order to declare loose links, you need to surround them with [url]http://yourlink.com[/url] tags.

Is there any way to workaround this?
I have some users for whom it is in impossible task to add the url tags :-(

For example if URL processing in the mantis formating plugin is disabled, could it be added automatically by the bbcode plugin?

I might be able to do some regex sorcery, but it's gonna take me a while. I am not an expert in regex 😞 ...

@FSD-Christian-ISS just sent you a pull requests, we are using this version internally now.

Fixed via #78.