Donate Share

newtelligence dasBlog Community Edition

Tracker: Bugs

5 $g(multiple words) doesn't work - ID: 1397557
Last Update: Comment added ( nobody )

$g(multiple words) should produce
<a href="http://www.google.com/search?q=multiple+words">
multiple words</a>. In other words, the spaces should
be URL encoded as pluses in the URL.

I spent some time looking into a fix. It doesn't seem
to be possible with a regex. See the thread I started at
http://regexadvice.com/forums/14513/ShowPost.aspx

My suggested fix.
$g(expr) ->
<a href="http://www.google.com/search?q=$h(${expr})">
${expr}</a>
where $h is a new kind of content filter, one that uses
a builtin function to URL encode the string.


George V. Reilly ( george_v_reilly ) - 2006-01-05 08:12

5

Closed

Fixed

Scott Hanselman

Macros and Templates

v1.9

Public


Comments ( 2 )




Date: 2009-06-08 13:30
Sender: nobody

<a href="<http://groups.google.com/group/buy-best-generic-valium>">buy
valium</a>


Date: 2006-08-23 18:31
Sender: glucopilotProject AdminAccepting Donations

Logged In: YES
user_id=466973

We added a new $url() one:

<ContentFilter find="\$g\((?&lt;expr&gt;[\w\s\d]+)\)"
replace="&lt;a
href=&quot;http://www.google.com/search?q=$url(${expr})&quot;&gt;${expr}&lt;/a&gt;"
isregex="true" />
<ContentFilter find="\$d\((?&lt;expr&gt;[\w\s\d]+)\)"
replace="&lt;a
href=&quot;http://dictionary.reference.com/search?q=$url(${expr})&quot;&gt;${expr}&lt;/a&gt;"
isregex="true" />



Log in to comment.

Attached File ( 1 )

Filename Description Download
contentfilterchange.patch Example Patch File Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2006-08-23 18:31 glucopilot
resolution_id None 2006-08-23 18:31 glucopilot
artifact_group_id v1.8.3 2006-08-23 18:31 glucopilot
assigned_to nobody 2006-08-23 18:31 glucopilot
close_date - 2006-08-23 18:31 glucopilot
File Added 187364: contentfilterchange.patch 2006-08-02 19:27 glucopilot