Opened 12 years ago

Closed 12 years ago

#119 closed enhancement (fixed)

match multiple instances in processTemplate()

Reported by: sheppard Owned by:
Priority: minor Milestone: 2.6.1
Component: GeoMOOSE/JS Version: 2.6
Keywords: Cc:

Description

Currently, if a template contains more than one instance of the same keyword, only the first will be matched:

GeoMOOSE.processTemplate("Hello, %name%! Nice to meet you, %name%!", {'name' : 'World'});

will return "Hello, World! Nice to meet you, %name%!".

A simple fix is to add the "global" flag to the first argument to replace().

Attachments (1)

geomoose.js.patch (501 bytes ) - added by sheppard 12 years ago.
replace all occurrences of key in processTemplate()

Download all attachments as: .zip

Change History (3)

by sheppard, 12 years ago

Attachment: geomoose.js.patch added

replace all occurrences of key in processTemplate()

comment:1 by jimk, 12 years ago

Status: newtesting

Committed in r865 in trunk.

comment:2 by sheppard, 12 years ago

Resolution: fixed
Status: testingclosed

Looks good.

Note: See TracTickets for help on using tickets.