# test.govlab/docs/core/converters/markdown.converter.test.ts

> 34 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-govlab-docs-core-converters-markdown-converter-test-ts
Source text: https://banes-lab.com/source/testing/test.govlab/docs/core/converters/markdown.converter.test.ts.txt

Listed in [test.govlab/docs/core/converters](https://banes-lab.com/api/source/testing/test.govlab/docs/core/converters.md), after [test.govlab/docs/core/converters/layer.converter.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/converters/layer.converter.test.ts.md) and before [test.govlab/docs/core/converters/package.converter.test.ts](https://banes-lab.com/source/testing/test.govlab/docs/core/converters/package.converter.test.ts.md).

## Contained in

- [test.govlab/docs/core/converters](https://banes-lab.com/anatomy/testing/folder-testing-test-govlab-docs-core-converters.md)

## Source

````typescript
import { backtickBarePaths, blankMarkup, stripInlineCode } from "@govlab/docs/core/converters/markdown.converter.ts";
import { describe, expect, it } from "vitest";

const blank = function blank(text: string): string {
    return " ".repeat(text.length);
};

describe("stripInlineCode and blankMarkup", () => {
    it("blank code spans and link targets while keeping every offset", () => {
        expect(stripInlineCode("run `a/b.ts` now")).toBe(`run ${blank("`a/b.ts`")} now`);
        expect(stripInlineCode("``x `y` z`` end")).toBe(`${blank("``x `y` z``")} end`);
        expect(blankMarkup("see [a](src/a.ts) and `b`")).toBe(`see [a${blank("](src/a.ts)")} and ${blank("`b`")}`);
    });
});

describe("backtickBarePaths", () => {
    it("wraps bare paths in prose and leaves frontmatter, code and existing spans alone", () => {
        const source = [
            "---",
            "governs: src/a.ts",
            "---",
            "Edit src/a.ts and `src/b.ts`.",
            "```",
            "src/c.ts",
            "```",
        ].join("\n");
        expect(backtickBarePaths(source).split("\n")).toStrictEqual([
            "---",
            "governs: src/a.ts",
            "---",
            "Edit `src/a.ts` and `src/b.ts`.",
            "```",
            "src/c.ts",
            "```",
        ]);
    });
});
````
