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

1

7

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?

Hemimorphite answered 13/2, 2013 at 9:0 Comment(4)
Try Foo![Bar]? Some wiki syntaxes use an exclamation point for escapeBlayze
@lc.: That has no effect.Hemimorphite
I believe the problem is that your macro is outputting the string in wiki-markup. A simple solution would be to make sure that you're not outputting wiki-markup. Maybe if you enclose the output in {html} tags.Potto
@MNRSullivan: Make that an answer so I can accept it...Hemimorphite
P
2

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.

Potto answered 15/2, 2013 at 0:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.