diff options
| author | John MacFarlane <[email protected]> | 2026-01-20 10:19:17 +0100 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2026-01-20 10:19:17 +0100 |
| commit | 9ea15ecee93b45c2d83aac579e4db10f19398ac9 (patch) | |
| tree | 4bb5d89658ea0453c9702c68d1b8ea0da3fa7b78 | |
| parent | eec51ddf16a6ce392c461810ce945880ef5362f5 (diff) | |
Wasm: support strip-comments.
| -rw-r--r-- | wasm/index.html | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/wasm/index.html b/wasm/index.html index 4d7a6be62..4e4244eff 100644 --- a/wasm/index.html +++ b/wasm/index.html @@ -829,6 +829,10 @@ <input type="checkbox" id="opt-preserve-tabs" v-model="opts.preserveTabs" /> <label for="opt-preserve-tabs">Preserve tabs</label> </div> + <div class="checkbox-group" v-show="showStripComments"> + <input type="checkbox" id="opt-strip-comments" v-model="opts.stripComments" /> + <label for="opt-strip-comments">Strip HTML comments</label> + </div> </div> </div> @@ -1440,6 +1444,7 @@ shiftHeading: '0', preserveTabs: false, tabStop: '4', + stripComments: false, trackChanges: '', citationMethod: '', mathMethod: '', @@ -1606,13 +1611,22 @@ get supportsListOf() { return this.listOfFormats.includes(this.effectiveOutputFormat); }, get isBinaryOutput() { return this.binaryFormats.includes(this.effectiveOutputFormat); }, - get showTrackChangesTab() { + get effectiveInputFormat() { let inFmt = this.inputFormat; if (inFmt === 'auto' && this.fileOrder.length > 0) { const ext = this.fileOrder[0].split('.').pop().toLowerCase(); inFmt = this.formatByExtension[ext] || ''; } - return inFmt === 'docx'; + return inFmt; + }, + + get showTrackChangesTab() { + return this.effectiveInputFormat === 'docx'; + }, + + get showStripComments() { + const fmt = this.effectiveInputFormat; + return fmt === 'auto' || this.markdownFormats.includes(fmt) || fmt === 'textile'; }, get showExtensionsTab() { @@ -2241,6 +2255,7 @@ if (this.opts.preserveTabs) opts['preserve-tabs'] = true; const tabStop = parseInt(this.opts.tabStop); if (tabStop !== 4) opts['tab-stop'] = tabStop; + if (this.opts.stripComments) opts['strip-comments'] = true; // Track changes if (this.opts.trackChanges) opts['track-changes'] = this.opts.trackChanges; |
