Defect #33432
openRendering of Macros with (empty) text parameter different in preview and non preview mode
0%
Description
Macros with empty text parameter are rendered differently in preview mode vs. non preview mode.
The preview mode seems to parse the the closing double curly brackets as text parameter and does not stop until the next macros double curly brackets, while the non preview mode parses an empty text parameter.
The sample code below shows demonstrates this with the collapse macro, but it happens for any macro which allows a text parameter and the two attached images.
This might be an issue with a greedy regular expression.
Test code for the bug in Redmine 4.x {{collapse(Collapse 1)}} Above is a empty collapse macro which renders correctly in preview and in wiki view. {{collapse(Collapse 2) }} Above is a empty collapse macro which renders correctly in wiki view but this text (and the following macro up to its closing curly brackets) will not be visible in preview mode. {{collapse(Collapse 3) This is a block of text that is collapsed by default. It can be expanded by clicking a link. }} Above is a non empty collapse macro which renders correctly in preview and in wiki view.
Test code for the bug in Redmine 4.x
Above is a empty collapse macro which renders correctly in preview and in wiki view.
Above is a empty collapse macro which renders correctly in wiki view but this text (and the following macro up to its closing curly brackets) will not be visible in preview mode.
Above is a non empty collapse macro witch renders correctly in preview and in wiki view.
Environment:
Redmine version 4.1.1.stable
Ruby version 2.6.6-p146 (2020-03-31) [x86_64-linux]
Rails version 5.2.4.2
Environment production
Database adapter PostgreSQL
Mailer queue ActiveJob::QueueAdapters::AsyncAdapter
Mailer delivery smtp
SCM:
Subversion 1.10.4
Git 2.20.1
Filesystem
Xitolite 2.20.1
Redmine plugins:
additionals 2.0.24-master
redmine_advancedimage 0.0.4
redmine_agile 1.5.3
redmine_checklists 3.1.16
redmine_filelinks 0.0.0
redmine_git_hosting 4.0.2
redmine_latex_mathjax 0.4.0
redmine_lightbox2 0.5.1
redmine_local_avatars 1.0.0
redmine_mentions 1.0.0
redmine_postgresql_search 1.0.6
redmine_recurring_tasks 0.3.4
redmine_reporting 2.0.6
redmine_wiki_lists 0.0.9
redmine_wikiapproval 0.0.0
redmine_wikiforms 0.0.0
redmineup_tags 2.0.8
sidebar_hide 0.0.8-fix
Files