Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenquotes.git

Adds ability to use right single quotes for typographic reasons

AuthorDaveJarvis <email>
Date2024-10-09 17:24:15 GMT-0700
Commit37580aabca8b01a9504dabb871a349bf238abbc5
Parent1fae3e3
README.md
See the source code for details.
+# Apostrophes
+
+In UNICODE, apostrophes have no semantic meaning. This unfortunate decision
+means that you have a choice in how straight apostrophes are converted to
+your typographic requirements. Using the `-a` option, you may provide one
+of the following values:
+
+* `regular` -- Keep the straight apostrophe (and curl using the font).
+* `modifier` -- Use UNICODE character 0x02BC.
+* `apos` -- Use `&apos;`, which is not HTML4-compliant.
+* `aposhex` -- Use `&#x27;`, which works with HTML4.
+* `quote` -- Use `&rsquo;`, which is semantically incorrect and will likely produce the desired typography.
+* `quotehex` -- Use `&#8217;`, which will likely produce the desired typography without embedding the semantically misleading "name" of "right single quote".
+
# Build
src/main/java/com/whitemagicsoftware/keenquotes/app/Settings.java
@CommandLine.Option(
names = {"-a", "--apostrophe"},
- description = "Converted apostrophe entity (regular, modifier, hex, entity)"
+ description = "Converted apostrophe entity (see docs)"
)
private String mApostrophe;
src/main/java/com/whitemagicsoftware/keenquotes/parser/Apostrophe.java
CONVERT_MODIFIER( "&#x2bc;", "modifier" ),
/**
+ * Apostrophes become XML APOSTROPHE ({@code &apos;}).
+ */
+ CONVERT_APOS( "&apos;", "apos" ),
+ /**
* Apostrophes become APOSTROPHE ({@code &#x27;}).
*/
- CONVERT_APOS_HEX( "&#x27;", "hex" ),
+ CONVERT_APOS_HEX( "&#x27;", "aposhex" ),
/**
- * Apostrophes become XML APOSTROPHE ({@code &apos;}).
+ * Apostrophes become RIGHT SINGLE QUOTATION MARK ({@code &rsquo;}).
*/
- CONVERT_APOS_ENTITY( "&apos;", "entity" );
+ CONVERT_RSQUOTE( "&rsquo;", "quote" ),
+ /**
+ * Apostrophes become RIGHT SINGLE QUOTATION MARK in hex ({@code &#8217;}).
+ */
+ CONVERT_RSQUOTE_HEX( "&#8217;", "quotehex" );
private final String mCode;
Delta26 lines added, 4 lines removed, 22-line increase