Defect #11736

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

Added by Anton Argirov over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Wiki
Target version:-
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

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

Associated revisions

Revision 10276
Added by Jean-Philippe Lang over 8 years ago

Fixed: New multi-line macros regexp is too eager (#11736).

Revision 10277
Added by Toshi MARUYAMA over 8 years ago

fix typo "MACROS_SUB_RE" (#11736)

Contributed by Anton Argirov.

History

#1 Updated by Toshi MARUYAMA over 8 years ago

  • Target version set to 2.1.0

#2 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Fix committed in r10276 with test. Thanks for pointing this out.

#3 Updated by Toshi MARUYAMA over 8 years ago

  • Target version deleted (2.1.0)

Also available in: Atom PDF