Defect #12451

Macros.rb extract_macro_options should use lazy search

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

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

0%

Category:Text formatting
Target version:2.1.5
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.

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

Associated revisions

Revision 10885
Added by Jean-Philippe Lang almost 5 years ago

Fixed that #extract_macro_options should not be greedy (#12451).

Revision 11007
Added by Jean-Philippe Lang almost 5 years ago

Merged r10885 from trunk (#12451).

History

#1 Updated by Jean-Philippe Lang almost 5 years ago

  • Category set to Text formatting
  • Status changed from New to Resolved
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.1.5
  • Resolution set to Fixed

Fixed and tests added in r10885, thanks.

#2 Updated by Jean-Philippe Lang almost 5 years ago

  • Status changed from Resolved to Closed

Merged in 2.1-stable.

Also available in: Atom PDF