Skip to content

Commit

Permalink
chore(deps): Remove no longer maintained trim package
Browse files Browse the repository at this point in the history
Removing trim as dependency as it is no longer maintained and has security issues
  • Loading branch information
Stefan Richter committed Apr 5, 2023
1 parent 664702c commit f40c695
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"remark-rehype": "^7.0.0",
"remark-slug": "^6.0.0",
"remark-stringify": "^8.0.0",
"trim": "^1.0.1",
"unified": "^8.4.0",
"unist-util-flatmap": "^1.0.0",
"unist-util-map": "^3.1.2",
Expand Down
7 changes: 3 additions & 4 deletions processor/parse/flavored/callout.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/* eslint-disable consistent-return */
import emojiRegex from 'emoji-regex';
import interrupt from 'remark-parse/lib/util/interrupt';
import trim from 'trim';

const themes = {
'\uD83D\uDCD8': 'info',
Expand Down Expand Up @@ -106,7 +105,7 @@ function blockquoteReadme(eat, value, silent) {

content = value.slice(index, nextIndex);

if (!prefixed && !trim(content)) {
if (!prefixed && !content.trim()) {
index = startIndex;
break;
}
Expand Down Expand Up @@ -141,8 +140,8 @@ function blockquoteReadme(eat, value, silent) {
const [match, icon] = contents[0].match(regex) || [];

if (icon) {
const title = trim(contents[0].slice(match.length));
const body = trim(contents.slice(1).join(lineFeed));
const title = contents[0].slice(match.length).trim();
const body = contents.slice(1).join(lineFeed).trim();

const data = {
hName: 'rdme-callout',
Expand Down

0 comments on commit f40c695

Please sign in to comment.