Schematron: spacing before <ph> element
Posted: Fri Apr 23, 2021 2:47 pm
I found a Schematron rule on Stack Overflow to check spaces before inline elements which is very handy.
https://stackoverflow.com/questions/375 ... schematron
It helps me to find spaces around <ph> tags.
However it doesn't work when the Indent inline elements is ticked in the preferences. This is how it looks like in Author mode with Indent inline elements option ticked: This is the same example in Text mode with Indent inline elements option ticked: How can I update the rule in such a way that it doens't show this message when the Indent inline elements is ticked? Because in the Author mode I can see a space.
https://stackoverflow.com/questions/375 ... schematron
Code: Select all
<sch:pattern id="space-inline-elements-before">
<sch:rule context="ph">
<sch:assert test="ends-with(preceding::text()[1], ' ')"
role="warning"
sqf:fix="add-space-before-ph">Add space before <ph></sch:assert>
<sqf:fix id="add-space-before-ph">
<sqf:description>
<sqf:title>Add space before <ph></sqf:title>
</sqf:description>
<sqf:add position="before" match="." select="' '"/>
</sqf:fix>
</sch:rule>
</sch:pattern>
It helps me to find spaces around <ph> tags.
However it doesn't work when the Indent inline elements is ticked in the preferences. This is how it looks like in Author mode with Indent inline elements option ticked: This is the same example in Text mode with Indent inline elements option ticked: How can I update the rule in such a way that it doens't show this message when the Indent inline elements is ticked? Because in the Author mode I can see a space.