mirror of
https://github.com/standardebooks/web.git
synced 2025-07-12 17:42:29 -04:00
Transplant all-caps xpath command to step-by-step guide
This commit is contained in:
parent
35ec084682
commit
3d629cdefb
1 changed files with 2 additions and 1 deletions
|
@ -233,7 +233,8 @@ proceed to seal up my confession, I bring the life of that unhappy Henry Jekyll
|
|||
</li>
|
||||
<li>
|
||||
<p><a href="/manual/latest/8-typography#8.3.3">Text in all caps</a>. Text in all caps is almost never correct, and should either be converted to lowercase with the <code class="html"><span class="p"><</span><span class="nt">em</span><span class="p">></span></code> element (for spoken emphasis), <code class="html"><span class="p"><</span><span class="nt">strong</span><span class="p">></span></code> (for extreme spoken emphasis), or <code class="html"><span class="p"><</span><span class="nt">b</span><span class="p">></span></code> (for unsemantic small caps, like in storefront signs).</p>
|
||||
<p>Use this <strong>case-sensitive</strong> regex to find text in all caps: <code class="regex">(?<span class="p"><</span>!en-)(?<span class="p"><</span>!z3998:roman">)(?<span class="p"><</span>![A-Z])[A-Z]{2,}(?!")</code></p>
|
||||
<p>Use the following command to check for instance of all caps:</p>
|
||||
<code class="terminal"><b>se</b> xpath <i>"//p//text()[re:test(., '[A-Z]{2,}') and not(contains(., 'OK') or contains(., 'SOS')) and not(parent::abbr or parent::var or parent::a or parent::*[contains(@epub:type, 'z3998:roman')])]"</i> <u>src/epub/text/<i class="glob">*</i>.xhtml</u></code>
|
||||
</li>
|
||||
<li>
|
||||
<p>Sometimes <code class="bash"><b>se</b> typogrify</code> doesn’t close quotation marks near em-dashes correctly.</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue