File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 7777
7878## Miscellaneous
7979
80+ - Render: ability to compose ` --to all ` with other formats (e.g. ` --to all,json ` )
8081- Don't call Deno.realPathSync on Windows (avoid problems w/ UNC paths)
8182- Don't include Unicode literals on Windows directly (#2184 ), thanks @yihui
8283- Improve YAML validation error messages on values of type object (#2191 )
Original file line number Diff line number Diff line change @@ -123,12 +123,19 @@ export async function resolveFormatsFromMetadata(
123123
124124 // determine render formats
125125 const renderFormats : string [ ] = [ ] ;
126- if ( flags ?. to === undefined || flags ?. to === "all" ) {
126+ if ( flags ?. to === undefined ) {
127127 renderFormats . push ( ...formats ) ;
128128 } else if ( flags ?. to === "default" ) {
129129 renderFormats . push ( formats [ 0 ] ) ;
130130 } else {
131- renderFormats . push ( ...flags . to . split ( "," ) ) ;
131+ const toFormats = flags . to . split ( "," ) . flatMap ( ( to ) => {
132+ if ( to === "all" ) {
133+ return formats ;
134+ } else {
135+ return [ to ] ;
136+ }
137+ } ) ;
138+ renderFormats . push ( ...toFormats ) ;
132139 }
133140
134141 const resolved : Record < string , Format > = { } ;
You can’t perform that action at this time.
0 commit comments