Closed martindholmes closed 2 years ago
@sydb Feel free to simplify the XPath. I wasn't firing on all cylinders when I wrote the if-then-else stuff. Re the width/height: I was looking for a way to handle those attributes because the TEI has them, and most of us would use them; Common Markdown doesn't provide a way to do that, but the widely-used Kramdown editor implements what I've included. The alternative is to output an HTML img tag; we could branch on whether those atts are there, and fall back to an img tag if they are, and that would work for almost all Markdown implementations, but it's not Markdown, of course.
@sydb I've updated the XPath per your suggestion, and added a missing colon for compliance with the Kramdown syntax.
Excellent. I had never heard of Kramdown. Learned something new. (Can I go home now?)
I have run the test above, and it works for me.
Would you be opposed to changing lines 253–260 to the following?
<xsl:sequence select="
'!['
||$altText
||']('
||@url
||' "'
||$titleText
||'")'
||string-join( $dim, '')
"/>
Either way, I think PR is fine to be merged. Yes, there is still a lot to be done in this conversion, but it is 1 step better than what we have now.
@sydb Done and tested again.
Seems pretty simple, so just merged.
I've added handling for TEI graphic elements in tei-to-markdown.xsl per issue #511. You can test this by running this in the Stylesheets repo root:
bin/teitomarkdown Test2/inputFiles/generalP5.xml Test2/outputFiles/test.md
then looking at the file
Test2/outputFiles/test.md