Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
Remade HTTP blocks 🪵
  • Loading branch information
FAXES authored Aug 15, 2024
1 parent d2bac0d commit 4285495
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function convert(string, options = {sanitize: false, plainText: false}) {
if(options.plainText) return string.replaceAll('\n', ' ').replaceAll('\r', '');
string = string.replace(/(?:\n\n|\n)/g, '<br>');
for (let key of Object.keys(module.exports.cache)) {
if (string.includes(key)) {
if(string.includes(key)) {
string = string.replace(key, module.exports.cache[key]);
delete module.exports.cache[key];
};
Expand All @@ -98,8 +98,9 @@ function convert(string, options = {sanitize: false, plainText: false}) {
function render(string, options = {}) {
return convert(string, options);
}
function updateCache(cache) {
module.exports.cache = cache;

function updateCache(key, content) {
module.exports.cache[key] = content;
}

function findNextMatch(string, initial, ending, startPosition) {
Expand Down

0 comments on commit 4285495

Please sign in to comment.