Map rendered text/html position to Markdown position.
Map rendered text/html position to Markdown position.
Install with npm:
npm install position-map-text-to-markdown
import {findAllPositions} from "position-map-text-to-markdown";
const results = findAllPositions({
text: "match",
markdown: "**match** __match__"
});
assert.ok(results.length === 2);
const [result1, result2] = results;
assert.deepEqual(result1, {
markdown: "match",
range: [2, 7],
loc: {
start: { line: 1, column: 2 },
end: { line: 1, column: 7 }
}
});
assert.deepEqual(result2, {
markdown: "match",
range: [12, 17],
loc: {
start: { line: 1, column: 12 },
end: { line: 1, column: 17 }
}
});
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu