0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-31 06:32:37 +00:00

add trimReturns() method to strings to trim render output

This commit is contained in:
Gazook89
2023-04-03 20:53:07 -05:00
parent b948106500
commit 9f17f36a87

View File

@@ -3,6 +3,12 @@
const dedent = require('dedent-tabs').default;
const Markdown = require('naturalcrit/markdown.js');
// Marked.js adds line returns after closing tags on some default tokens.
// This removes those line returns for comparison sake.
String.prototype.trimReturns = function(){
return this.replace(/\r?\n|\r/g, '');
};
test('Renders a mustache span with text only', function() {
const source = '{{ text}}';
const rendered = Markdown.render(source);