Dave Jarvis' Repositories

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

Move XML-awareness into typographer for curling straight quotes

AuthorDaveJarvis <email>
Date2021-07-02 23:35:24 GMT-0700
Commit78550aa49307ccba507edc0d3170a8c7c2206da1
Parenta09bc5d
Delta3 lines added, 9 lines removed, 6-line decrease
src/test/java/com/keenwrite/quotes/TypographerTest.java
package com.keenwrite.quotes;
-import com.keenwrite.dom.DocumentParser;
import org.junit.jupiter.api.Test;
@Test
void test_Quotes_Straight_Curly() throws IOException {
- final var xhtml = read( "17165.html" );
- final var doc = DocumentParser.parse( xhtml );
-
- Typographer.curl( doc );
+ Typographer.curl( read( "17165.html" ) );
}
src/main/java/com/keenwrite/processors/XhtmlProcessor.java
} );
- if( curl() ) {
- Typographer.curl( doc );
- }
+ final var document = DocumentParser.toString( doc );
- return DocumentParser.toString( doc );
+ return curl() ? Typographer.curl( document ) : document;
} catch( final Exception ex ) {
clue( ex );