Search code examples
htmlgrailshyperlinkgsp

HTML/Grails- how to display a link as regular text


I have to present a link argument as a regular string/text (so the user won't be able to click the link)

<span class="text-light">
    ${statusMessage?.toHtml()}
    ${statusMessage?.link}
</span>

${statusMessage?.link} is the argument link which present like(e.g)

<a href="/threebaysover/product/show/OQ%3D%3D" class="ui-link">2 tour</a>

Solution

  • You can try this:

    ${statusMessage?.link?.replaceAll("<(.|\n)*?>", '')​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​}