Fixed handling of quotation marks inside script "one-liners"

This commit is contained in:
Jeff Parsons 2017-02-06 18:06:40 -08:00 committed by Jeff Parsons
commit 0caa27023c

View file

@ -19,4 +19,4 @@ should generate something like this:
<button type="button" onclick="commandMachine('vt100','Keyboard','script','...')">Try It!</button>
{% endcomment %}
{% if page.commands[include.command] != nil %}{% assign machine_command = "script" %}{% capture command_value %}{{ page.commands[include.command] | replace:'"','&quot;' | strip }}{% endcapture %}{% else %}{% capture machine_command %}{{ include.command }}{% endcapture %}{% capture command_value %}{{ include.value }}{% endcapture %}{% endif %}{% if include.type == "button" %}<button type="button" onclick="commandMachine('{{ include.machine }}','{{ include.component }}','{{ machine_command }}','{{ command_value }}')">{{ include.label }}</button>{% else %}<!-- Unrecognized machine control type: {{ include.type }} -->{% endif %}
{% if page.commands[include.command] != nil %}{% assign machine_command = "script" %}{% capture command_value %}{{ page.commands[include.command] | replace:'"','&quot;' | strip }}{% endcapture %}{% else %}{% capture machine_command %}{{ include.command }}{% endcapture %}{% capture command_value %}{{ include.value | replace:'"','&quot;' }}{% endcapture %}{% endif %}{% if include.type == "button" %}<button type="button" onclick="commandMachine('{{ include.machine }}','{{ include.component }}','{{ machine_command }}','{{ command_value }}')">{{ include.label }}</button>{% else %}<!-- Unrecognized machine control type: {{ include.type }} -->{% endif %}