A few years back (!) I had a sync/db/upload problem, and some of my local listing descriptions got converted from Markdown to HTML.
I use Markdown exclusively when composing, and there’s no broadly-applicable HTML-to-GS-markdown conversion I can trust (though I am considering writing a simple one for other reasons).
Anyway, I’ve been OK for some time, but today when I am trying to amend some text and add more detailed descriptions to older listings, the 100 or so listings that are in HTML keep getting in the way.
Ideally, I’d like to be able to make a Smart Folder or script that detects the HTML code in the description field, but some experimentation makes me believe GarageSale is pre-converting the descriptions before a Find is applied—which means I can’t search for “<span” or anything in the description text. And I can’t find any way to search for “Uses convert Markdown”, either, which would be OK.
This script lists all listings (of the selected listing) that does NOT use “Convert Markdown to HTML”:
function run() {
var arr = [];
for (const listing of selectedListings) {
if (!listing.convertMarkdownToHTML) {
arr.push(listing);
}
}
showListings(arr, "These listings do NOT use 'Convert Markdown to HTML'");
}
In case anybody else needs to convert HTML description text back to Markdown, I have a ugly/kludgy way and a programmatic way.
Ugly: view listing as preview (or Live), copy text you want to convert, paste into Obsidian.app (with Convert pasted HTML to markdown), select all, copy, come back to GS, change to pencil mode, paste back in
Programmatic: Obsidian.app uses the turndown library to convert HTML → markdown, so one can write an (external) JS script to invoke that. I don’t believe GarageSale can invoke libraries directly.