Project

General

Profile

Actions

Defect #11736

closed

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

Added by Anton Argirov over 11 years ago. Updated over 11 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 #1

Updated by Toshi MARUYAMA over 11 years ago

  • Target version set to 2.1.0
Actions #2

Updated by Jean-Philippe Lang over 11 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.

Actions #3

Updated by Toshi MARUYAMA over 11 years ago

  • Target version deleted (2.1.0)
Actions

Also available in: Atom PDF