$doc.getPlainTitle() is returning more than a plain string

I’m trying to use the .getPlainTitle method to get an unformatted string with the document, but I’m getting html back with href link coding… basically the same thing I would have gotten with the getTitle method.

I am on version 10.11.9

$doc.getTitle() returns the title as it’s entered by the user and not HTML.

getPlainTitle() returns plain text, not HTML.

What’s your document’s title? How can we reproduce the problem?

The title can only contain velocity and plain text. So if you put HTML in it or any other syntax, it’s considered as plain text characters.

For example:

28

Will give:

53

Notice the escaped ** since it’s not considered XWiki Syntax 2.1 when it’s in the title (it’s considered as two star characters). Same for the HTML.

$doc.getRenderedTitle('xhtml/1.0') would give Hello <p>**world**</p>