Project

General

Profile

Actions

Defect #12451

closed

Macros.rb extract_macro_options should use lazy search

Added by Michael Esemplare almost 12 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Normal
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I am unsure if the design was intended to be greedy, however for my macro I needed a lazy search since it took in a query string like: query=?show_issues=1&show_news=1&show_documents=1&show_files=1&show_wiki_edits=1. The current method matches "query=?show_issues=1&show_news=1&show_documents=1&show_files=1&show_wiki_edits" : "1". When I look for options[:query] it returns nil. By using a lazy search, I get the intended result: "query" : "?show_issues=1&show_news=1&show_documents=1&show_files=1&show_wiki_edits=1"

Perhaps we should be able to specify if greedy or lazy?

I have attached my "quite simple" patch.


Files

wiki_formatting_macros.rb.patch (486 Bytes) wiki_formatting_macros.rb.patch Michael Esemplare, 2012-11-26 22:38
Actions

Also available in: Atom PDF