Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Custom link with label has closing bracket #5355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AskHafssa opened this issue Mar 5, 2025 · 1 comment
Open

Custom link with label has closing bracket #5355

AskHafssa opened this issue Mar 5, 2025 · 1 comment

Comments

@AskHafssa
Copy link

Hi,

I'm facing an issue with using hyperlink. if label has a closing bracket in it, then the rest of the label is not included in the hyperlink.

*** Settings ***
Metadata	Whole tile in hyperlink    [url|my awesome title]
Metadata	Missing part of tile in hyperlink    [url|my [other] awesome title]

*** Test Cases ***
Dummy
    No Operation

Image

Thank you in advance for your help!

@pekkaklarck
Copy link
Member

The link syntax supported by Robot is [url|title]. This problem occurs because the link formatter matches the opening [ with the first closing ] and thus in [url|my [other] awesome title] the URL is url and the title is my [other.

The problem could be fixed by making the formatter smarter. It could handle opening [ in URL and title parts so that the next closing ] would be considered a literal value and not closing the whole link. It would require changing the current regexp based approach to a smarter parser. It wouldn't be that complicated, but the change isn't trivial either. There's also a problem with handling unbalanced bracket usages like [url|tit[le].

I personally don't consider the problem so bad that fixing it would be worth the effort. That said, if someone else is interested to fix it, I'm happy to review and merge PRs. One reason I don't consider this too high priority is that I think we should move from our custom documentation format to Markdown in the future. We are planning to take the first steps to that direction in RF 7.3 (#5304) and hopefully can extend to support to suite documentation and metadata in the future. After that enhancing our own syntax makes pretty much no sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants