Improve rendering search results of plugin content types on web interface

Render only the entry from plugin search response instead of raw json
Use the results-ledger styling for results-plugin styling
This commit is contained in:
Debanjum Singh Solanky 2023-02-24 15:53:58 -06:00
parent c2814fce58
commit 88344f9ed2

View file

@ -56,7 +56,9 @@
} else if (type === "ledger") {
return render_ledger(query, data);
} else {
return `<pre id="json">${JSON.stringify(data, null, 2)}</pre>`;
return `<div id="results-plugin">`
+ data.map((item) => `<p>${item.entry}</p>`).join("\n")
+ `</div>`;
}
}
@ -277,9 +279,10 @@
#json {
white-space: pre-wrap;
}
#results-plugin,
#results-ledger {
white-space: pre-line;
text-align: left;
white-space: pre-line;
}
#results-markdown {
text-align: left;