Skip to content

Commit

Permalink
fix(view:codeblock:markmap): depth + 1, wikilinks, extra \n
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed May 5, 2024
1 parent d2f8d19 commit 088176d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/markmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ const from_tree = (tree: EdgeTree[], options?: Options) => {
let markmap = "";

tree.forEach((item) => {
const hashes = "#".repeat(item.depth);
const hashes = "#".repeat(item.depth + 1);

const link = Links.ify(
item.edge.target_id,
Paths.show(item.edge.target_id, options?.show_node_options),
{ link_kind: "markdown" },
{ link_kind: "wiki" },
);

const attr = options?.show_attributes
? ` (${url_search_params(untyped_pick(item.edge.attr, options.show_attributes), { trim_lone_param: true })})`
: "";

markmap += `${hashes} ${link}${attr}\n`;
markmap += `${hashes} ${link}${attr}\n\n`;

if (item.children.length) {
markmap += from_tree(item.children, options);
Expand Down

0 comments on commit 088176d

Please sign in to comment.