Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/keenwrite.git
M libs/keenquotes.jar
Binary file
M src/main/java/com/keenwrite/processors/XhtmlProcessor.java
8080
          final var attrs = node.getAttributes();
8181
82
          if( attrs != null ) {
83
            final var attr = attrs.getNamedItem( "src" );
82
          final var attr = attrs.getNamedItem( "src" );
8483
85
            if( attr != null ) {
86
              final var imageFile = exportImage( attr.getTextContent() );
84
          if( attr != null ) {
85
            final var imageFile = exportImage( attr.getTextContent() );
8786
88
              attr.setTextContent( imageFile.toString() );
89
            }
87
            attr.setTextContent( imageFile.toString() );
9088
          }
9189
        } catch( final Exception ex ) {
...
169167
    // Download remote resources into temporary files.
170168
    if( protocol.isRemote() ) {
171
      final var response = httpGet( src );
172
      final var mediaType = response.getMediaType();
169
      try( final var response = httpGet( src ) ) {
170
        final var mediaType = response.getMediaType();
173171
174
      imageFile = mediaType.createTemporaryFile( APP_TITLE_LOWERCASE );
172
        imageFile = mediaType.createTemporaryFile( APP_TITLE_LOWERCASE );
175173
176
      try( final var image = response.getInputStream() ) {
177
        copy( image, imageFile, REPLACE_EXISTING );
178
      }
174
        try( final var image = response.getInputStream() ) {
175
          copy( image, imageFile, REPLACE_EXISTING );
176
        }
179177
180
      // Strip comments, superfluous whitespace, DOCTYPE, and XML declarations.
181
      if( mediaType.isSvg() ) {
182
        DocumentParser.sanitize( imageFile );
178
        // Strip comments, superfluous whitespace, DOCTYPE, and XML
179
        // declarations.
180
        if( mediaType.isSvg() ) {
181
          DocumentParser.sanitize( imageFile );
182
        }
183183
      }
184184
    }