tdiary/tdiary-core — pull request #331 by kou (2013-07-14 10:38:54+00:00)
Title: Support my plugin in fn plugin for RD style

RD style expands

((-((<20130714>))-))

to

<%= fn <<-'0000random_id1111'
<%=my "20130714","20130714"%>
0000random_id1111
%>

"%>" in "<%= ... %>" confuses ERB:

% echo '<%= eval("<= 1 + 1 %>") %>' | erb -x
#coding:ASCII-8BIT
_erbout = ''; _erbout.concat(( eval("<= 1 + 1 ).to_s); _erbout.concat "\") %>\n"
; _erbout.force_encoding(__ENCODING__)

'eval("<%= 1 + 1 )...' is broken.

So "%>" should be escaped as "%%>".