Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can prevent confluence from auto-linkyfing square brackets produced by a macro?

I'm using Atlassian Confluence (woe is me).

I have an {sql} macro inside a groovy macro in a wiki markup block. Now, the SQL selects some strings which look like Foo[Bar]. The results wiki page auto-linkifies the bar, i.e. you get

FooBar

which is not what I want. I tried something like

SELECT REPLACE(REPLACE(name, '[', '\['), ']', '\]') FROM mytable;

but that triggered an error, while

SELECT REPLACE(REPLACE(name, '[', '\\['), ']', '\\]') FROM mytable;

didn't trigger an error but also did not help. What can I do?

like image 355
einpoklum Avatar asked Nov 04 '22 04:11

einpoklum


1 Answers

Your macro is outputting the string in wiki-markup. A simple solution would be to make sure that you're preventing the output being interpreted as wiki-markup, by enclosing the result in {html} tags.

like image 160
MNRSullivan Avatar answered Nov 14 '22 01:11

MNRSullivan