dsh-neotui 0.0.30 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/md.js +4 -1
package/package.json
CHANGED
package/src/md.js
CHANGED
|
@@ -246,7 +246,10 @@ export function renderMd(text, width) {
|
|
|
246
246
|
const codeLines = codeBuf.length === 0 ? [""] : codeBuf;
|
|
247
247
|
let maxLen = Math.max(...codeLines.map((l) => strWidth(l)), 1);
|
|
248
248
|
const barW = Math.min(hw, maxLen + 2);
|
|
249
|
-
|
|
249
|
+
// a fence WITHOUT a language gets no label — the bare "text" tag next
|
|
250
|
+
// to the box corner just looks like a rendering artifact
|
|
251
|
+
const tag = lang && lang !== "text" ? " " + lang : "";
|
|
252
|
+
lines.push([SEG("┌" + "─".repeat(Math.max(1, barW - 2)) + "┐" + tag, { fg: C.hr })]);
|
|
250
253
|
for (const cl of codeLines) {
|
|
251
254
|
const hls = highlightLine(cl, lang);
|
|
252
255
|
lines.push([SEG("│ ", { fg: C.hr }), ...wrapSegs(hls, hw, { pad: true }).map((l) => l).flatMap((l, k) => (k === 0 ? l : [SEG(" ", { fg: C.hr }), ...l])), SEG(" │", { fg: C.hr })]);
|