Monospaced text not correctly formatted
- Status
- Closed
- Subject
- Monospaced text not correctly formatted
- Version
- 2.x
- Category
- Conflict of two features (each works well independently)
- Usability
- Feature
- Wiki Syntax (text area, parser, external wiki, etc)
- Resolution status
- New
- Submitted by
- Atticus0307
- Lastmod by
- Landry Bitege
- Rating
- Description
Issue was described here:
http://tikiwiki.org/tiki-view_forum_thread.php?comments_parentId=31233&topics_sort_mode=lastPost_desc&forumId=4
When you insert text like:
"You should call -+intValue()+- in ...." then that comes out as:
"You should callintValue() in ...." with "intValue()" monospaced. Note the missing space.This is caused by the regular expression used to replace the Wiki Syntax with HTML.
The bug is in tikilib.php, line 6467.
It reads:// Replace monospaced text
$line = preg_replace("/(^|\s)-\+(.*?)\+-/", "< code >$2< /code >", $line);The first group captures the whitespace. But only the second capturing group is saved.
- Solution
Just as a proposal:
// Replace monospaced text
$line = preg_replace("/(^|\s)-\+(.*?)\+-/", "$1< code >$2< /code >", $line);This would preserve the whitespace if there is one.
- Workaround
- Importance
- 3
- Priority
- 15
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2211
- Created
- Tuesday 09 December, 2008 18:03:53 UTC
by Unknown - LastModif
- Monday 06 April, 2026 19:42:52 UTC