result[i] = tolower(result[i]);
}
- if (strstr(&result[strlen(result) - 2], "px")) {
- // Leave 'px' alone
- return result;
- }
-
// Trim anything other than digits
for (i = 0; result[i]; i++) {
if (result[i] < '0' || result[i] > '9') {
if (strcmp(a->key, "width") == 0) {
width = strip_dimension_units(a->value);
+ if (strlen(width) + 2 == strlen(a->value)) {
+ if (strcmp(&(a->value[strlen(width)]), "px") == 0) {
+ a->value[strlen(width)] = '\0';
+ }
+ }
+
if (strcmp(a->value, width) == 0) {
print_const(" ");
print(a->key);
} else if (strcmp(a->key, "height") == 0) {
height = strip_dimension_units(a->value);
+ if (strlen(height) + 2 == strlen(a->value)) {
+ if (strcmp(&(a->value[strlen(height)]), "px") == 0) {
+ a->value[strlen(height)] = '\0';
+ }
+ }
+
if (strcmp(a->value, height) == 0) {
print_const(" ");
print(a->key);
print_const("<");
break;
- case ESCAPED_CHARACTER:
+ case CRITIC_COM_OPEN:
+ print_const("{>>");
+ break;
+
+ case CRITIC_COM_CLOSE:
+ print_const("<<}");
+ break;
+
+ case CRITIC_SUB_DIV:
+ print_const("~>");
+ break;
+
+ case CRITIC_SUB_DIV_A:
+ print_const("~");
+ break;
+
+ case CRITIC_SUB_DIV_B:
+ print_const(">");
+ break;
+
+ case ESCAPED_CHARACTER:
print_const("\\");
mmd_print_char_html(out, source[t->start + 1], false);
break;
<text:p text:style-name="Standard">25</text:p>
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">{++foo++}</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">{--bar--}</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">{~~foo~>bar~~}</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">{>>foo<<}</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="Source_20_Text">{==bar==}</text:span></text:p>
+
+<text:p text:style-name="Standard">30</text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">$${++foo++}$$</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">$${--bar--}$$</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">$${~~foo~>bar~~}$$</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">$${>>foo<<}$$</text:span></text:p>
+
+<text:p text:style-name="Standard"><text:span text:style-name="math">$${==bar==}$$</text:span></text:p>
+
+<text:p text:style-name="Standard">35</text:p>
+
<text:p text:style-name="Standard"><text:span text:style-name="Underline">foo<text:span text:style-name="Underline"> bar</text:span></text:span></text:p>
<text:p text:style-name="Standard"><text:span text:style-name="Strike">foo<text:span text:style-name="Strike"> bar</text:span></text:span></text:p>
<p>25</p>
+<p><code>{++foo++}</code></p>
+
+<p><code>{--bar--}</code></p>
+
+<p><code>{~~foo~>bar~~}</code></p>
+
+<p><code>{>>foo<<}</code></p>
+
+<p><code>{==bar==}</code></p>
+
+<p>30</p>
+
+<p><span class="math">\[{++foo++}\]</span></p>
+
+<p><span class="math">\[{--bar--}\]</span></p>
+
+<p><span class="math">\[{~~foo~>bar~~}\]</span></p>
+
+<p><span class="math">\[{>>foo<<}\]</span></p>
+
+<p><span class="math">\[{==bar==}\]</span></p>
+
+<p>35</p>
+
<p><ins>foo<ins> bar</ins></ins></p>
<p><del>foo<del> bar</del></del></p>
<p>25</p>
+<p><code>{++foo++}</code></p>
+
+<p><code>{--bar--}</code></p>
+
+<p><code>{~~foo~>bar~~}</code></p>
+
+<p><code>{>>foo<<}</code></p>
+
+<p><code>{==bar==}</code></p>
+
+<p>30</p>
+
+<p>$${++foo++}$$</p>
+
+<p>$${--bar--}$$</p>
+
+<p>$${~~foo~>bar~~}$$</p>
+
+<p>$${>>foo<<}$$</p>
+
+<p>$${==bar==}$$</p>
+
+<p>35</p>
+
<p>{++foo{++ bar++}++}</p>
<p>{--foo{-- bar--}--}</p>
25
+\texttt{\{++foo++\}}
+
+\texttt{\{--bar--\}}
+
+\texttt{\{~~foo~>bar~~\}}
+
+\texttt{\{>>foo<<\}}
+
+\texttt{\{==bar==\}}
+
+30
+
+$${++foo++}$$
+
+$${--bar--}$$
+
+$${~~foo~>bar~~}$$
+
+$${>>foo<<}$$
+
+$${==bar==}$$
+
+35
+
\underline{foo\underline{ bar}}
\sout{foo\sout{ bar}}
25
+`{++foo++}`
+
+`{--bar--}`
+
+`{~~foo~>bar~~}`
+
+`{>>foo<<}`
+
+`{==bar==}`
+
+30
+
+$${++foo++}$$
+
+$${--bar--}$$
+
+$${~~foo~>bar~~}$$
+
+$${>>foo<<}$$
+
+$${==bar==}$$
+
+35
+
{++foo{++ bar++}++}
{--foo{-- bar--}--}
<office:text>
<text:p text:style-name="Standard"><draw:frame text:anchor-type="as-char"
draw:z-index="0" draw:style-name="fr1" svg:width="40pt">
-<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" >
+<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" svg:height="20pt" svg:width="40pt" >
<draw:image xlink:href="http://foo.bar/" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="<All formats>"/>
</draw:frame></text:p>
<text:p>Figure <text:sequence text:name="Figure" text:formula="ooow:Figure+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>: foo</text:p>
<text:p text:style-name="Standard"><draw:frame text:anchor-type="as-char"
draw:z-index="0" draw:style-name="fr1" svg:width="40pt">
-<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" >
+<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" svg:height="20pt" svg:width="40pt" >
<draw:image xlink:href="http://foo.bar/" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="<All formats>"/>
</draw:frame></text:p>
<text:p>Figure <text:sequence text:name="Figure" text:formula="ooow:Figure+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>: <text:span text:style-name="MMD-Italic">bar</text:span></text:p>
<text:p text:style-name="Standard"><draw:frame text:anchor-type="as-char"
draw:z-index="0" draw:style-name="fr1" svg:width="40pt">
-<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" >
+<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" svg:height="20pt" svg:width="40pt" >
<draw:image xlink:href="http://foo.bar/" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="<All formats>"/>
</draw:frame></text:p>
</draw:text-box></draw:frame>
bar</text:p>
+<text:p text:style-name="Standard"><draw:frame text:anchor-type="as-char"
+draw:z-index="0" draw:style-name="fr1" svg:width="40pt">
+<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" svg:height="20pt" svg:width="40pt" >
+<draw:image xlink:href="http://foo.bar/" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad" draw:filter-name="<All formats>"/>
+</draw:frame></text:p>
+<text:p>Figure <text:sequence text:name="Figure" text:formula="ooow:Figure+1" style:num-format="1"> Update Fields to calculate numbers</text:sequence>: <text:span text:style-name="MMD-Italic">foo</text:span></text:p>
+</draw:text-box></draw:frame>
+</text:p>
+
<text:p text:style-name="Standard"><draw:frame text:anchor-type="as-char"
draw:z-index="0" draw:style-name="fr1" svg:width="40pt">
<draw:text-box><text:p><draw:frame text:anchor-type="as-char" draw:z-index="1" >
<body>
<figure>
-<img src="http://foo.bar/" alt="foo" id="foo" title="foo" width="40px" />
+<img src="http://foo.bar/" alt="foo" id="foo" title="foo" width="40" height="20" />
<figcaption>foo</figcaption>
</figure>
<figure>
-<img src="http://foo.bar/" alt="bar" id="foo" title="foo" width="40px" />
+<img src="http://foo.bar/" alt="bar" id="foo" title="foo" width="40" height="20" />
<figcaption><em>bar</em></figcaption>
</figure>
-<p><img src="http://foo.bar/" alt="bar" id="foo" title="foo" width="40px" /> bar</p>
+<p><img src="http://foo.bar/" alt="bar" id="foo" title="foo" width="40" height="20" /> bar</p>
<figure>
-<img src="http://foo.bar/" alt="foo" title="foo" width="40px" />
+<img src="http://foo.bar/" alt="foo" title="foo" width="40" height="20" />
+<figcaption><em>foo</em></figcaption>
+</figure>
+
+<figure>
+<img src="http://foo.bar/" alt="foo" title="foo" width="40" />
<figcaption><em>foo</em></figcaption>
</figure>
<p>![<em>bar</em>][foo] bar</p>
+<p></p>
+
<p></p>
-<p>[foo]: http://foo.bar/ "foo" width="40px"</p>
+<p>[foo]: http://foo.bar/ "foo" width="40px" height="20px"</p>
\begin{figure}[htbp]
\centering
-\includegraphics[keepaspectratio,width=40pt,height=0.75\textheight]{http://foo.bar/}
+\includegraphics[width=40pt,height=20pt]{http://foo.bar/}
\caption{foo}
\label{foo}
\end{figure}
\begin{figure}[htbp]
\centering
-\includegraphics[keepaspectratio,width=40pt,height=0.75\textheight]{http://foo.bar/}
+\includegraphics[width=40pt,height=20pt]{http://foo.bar/}
\caption{\emph{bar}}
\label{foo}
\end{figure}
-\includegraphics[keepaspectratio,width=40pt,height=0.75\textheight]{http://foo.bar/} bar
+\includegraphics[width=40pt,height=20pt]{http://foo.bar/} bar
+
+\begin{figure}[htbp]
+\centering
+\includegraphics[width=40pt,height=20pt]{http://foo.bar/}
+\caption{\emph{foo}}
+\end{figure}
\begin{figure}[htbp]
\centering
![*bar*][foo] bar
+
+

-[foo]: http://foo.bar/ "foo" width="40px"
+[foo]: http://foo.bar/ "foo" width="40px" height="20px"
+
<p><a href="http://foo.net/">link</a> and <a href="http://bar.net" title="title" class="custom">link</a></p>
<figure>
-<img src="http://foo.bar/" alt="test" title="title" width="40px" height="400px" />
+<img src="http://foo.bar/" alt="test" title="title" width="40" height="400" />
<figcaption>test</figcaption>
</figure>
</head>
<body>
-<p>foo <img src="http://foo.bar/" alt="image" id="image" title="title" width="40px" height="400px" /></p>
+<p>foo <img src="http://foo.bar/" alt="image" id="image" title="title" width="40" height="400" /></p>
<p>foo <a href="http://foo.bar/1" class="external" style="border: solid black 1px;">link</a></p>
<p>foo <a href="http://foo.bar/3" class="external" style="border: solid black 1px;">link3</a></p>
<figure>
-<img src="http://foo.bar/" alt="test" title="title" width="40px" height="400px" />
+<img src="http://foo.bar/" alt="test" title="title" width="40" height="400" />
<figcaption>test</figcaption>
</figure>