| Author | DaveJarvis <email> |
|---|---|
| Date | 2022-01-06 22:34:39 GMT-0800 |
| Commit | 69196dee0dfd9de741680d393d55b5ce3b1c383c |
| Parent | 8350e8d |
| Delta | 12 lines added, 6 lines removed, 6-line increase |
| final Processor<String> processor; | ||
| - if( preview == null && outputType == MARKDOWN_PLAIN ) { | ||
| - processor = inputType == RMARKDOWN | ||
| - ? createInlineRProcessor( successor, context ) | ||
| - : createMarkdownProcessor( successor, context ); | ||
| + // When there's no preview, determine processor by file name extension. | ||
| + if( preview == null ) { | ||
| + if( outputType == MARKDOWN_PLAIN ) { | ||
| + processor = inputType == RMARKDOWN | ||
| + ? createInlineRProcessor( successor, context ) | ||
| + : createVariableProcessor( successor, context ); | ||
| + } | ||
| + else { | ||
| + processor = createMarkdownProcessor( successor, context ); | ||
| + } | ||
| } | ||
| else { |
| MEDIA_TEXT_R_MARKDOWN( TEXT_R_MARKDOWN, of( "Rmd" ) ), | ||
| MEDIA_TEXT_PROPERTIES( TEXT_PROPERTIES, of( "properties" ) ), | ||
| - MEDIA_TEXT_XHTML( TEXT_XHTML, of( "xhtml" ) ), | ||
| + MEDIA_TEXT_XHTML( TEXT_XHTML, of( "html", "xhtml" ) ), | ||
| MEDIA_TEXT_XML( TEXT_XML ), | ||
| MEDIA_TEXT_YAML( TEXT_YAML, of( "yaml", "yml" ) ), | ||
| * @return The associated {@link MediaType} as defined by IANA. | ||
| */ | ||
| - static MediaType getMediaType( final String extension ) { | ||
| + public static MediaType fromExtension( final String extension ) { | ||
| final var sanitized = sanitize( extension ); | ||