I have the following parse issue. In the first sample text below, the parse will hit the two command blocks as it finds the parts in the text.
Give the below a try (Rebol 2).
sample-text: {<a href="javascript:gotoURL('displayContent.aspx?contentID=9&language=english#Deferred-member');">deferred member</a>}
remove-anchors: func [sample-text][
parse sample-text[
some [
to {<a href="javascript:gotoURL('displayContent.aspx?contentID=9}
begin:
thru {);">}
ending:
(print "Command 1 executed" )
to "<"
begin:
thru ">"
ending:
(print "Command 2 executed" )
]
]
return sample-text
]
Result:
remove-anchors sample-text
Command 1 executed
Command 2 executed
However, if I insert the change/part portion of the command, which is expected to remove the text it finds, the first change/part executes but it appears the second portion of the parse command stops as the second execution block doesn't trigger.
sample-text: {<a href="javascript:gotoURL('displayContent.aspx?contentID=9&language=english#Deferred-member');">deferred member</a>}
remove-anchors: func [sample-text][
parse sample-text[
some [
to {<a href="javascript:gotoURL('displayContent.aspx?contentID=9}
begin:
thru {);">}
ending:
(print "Command 1 executed" change/part begin "" ending) ;<<----- change
to "<"
begin:
thru ">"
ending:
(print "Command 2 executed" change/part begin "" ending) ;<<----- change
]
]
return sample-text
]
Result:
remove-anchors sample-text
Command 1 executed
== "deferred member</a>"
Note the second command didn't seem to execute both by the Print not executing and the parse not completing.
Since I have multiple different types of links in the texts I'm trying to remove these pieces of HTML from, and multiple occurrences in the same text, I figured PARSE was the right solution.
Can anyone see what I am doing wrong?