Defect #11736
New multi-line macros regexp (MACROS_RE) is too eager
Status: | Closed | Start date: | ||
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | % 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
Associated revisions
Fixed: New multi-line macros regexp is too eager (#11736).
fix typo "MACROS_SUB_RE" (#11736)
Contributed by Anton Argirov.
History
#1
Updated by Toshi MARUYAMA almost 10 years ago
- Target version set to 2.1.0
#2
Updated by Jean-Philippe Lang almost 10 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 almost 10 years ago
- Target version deleted (
2.1.0)