Project

General

Profile

Actions

Defect #11736

closed

New multi-line macros regexp (MACROS_RE) is too eager

Added by Anton Argirov about 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Wiki
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Using trunk (pre-2.1.0) version, Ruby 1.9.3 (Windows)
Tried latest macros feature: multi-line macros. I wrote macro, called !{{lang}} to display different blocks of text depending of which locale is active.
See the example, that produce a bug:

{{lang(ru)
Some russian text
}}
{{lang(en)
Some english text
}}

According to MACROS_RE, it should extract exactly two macro appearances. However, it extracts only one macro with this body:

Some russian text
}}
{{lang(en)
Some english text

Attached a patch to fix this bug.
Note also another small change in the patch: "unless const_defined?(:MACRO_SUB_RE)*, instead of "unless const_defined?(:MACROS_SUB_RE)" in application_helper.rb


Files

Fixed_multi-line_macros.patch (1.06 KB) Fixed_multi-line_macros.patch Anton Argirov, 2012-08-30 06:07
Actions

Also available in: Atom PDF