New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gitbook-plugin-markdown-parse-add-br

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gitbook-plugin-markdown-parse-add-br - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

16

index.js

@@ -25,3 +25,3 @@ "use strict";

if (in_code_block) {
re += s.substr(pre, pos - pre);
re += s.substring(pre, pos);
//find code block end

@@ -34,3 +34,3 @@ if (4 <= pos - pre && "`" == s[pre] && "`" == s[pre + 1] && "`" == s[pre + 2]) {

else if (pre_empty_line && 4 <= pos - pre && "`" == s[pre] && "`" == s[pre + 1] && "`" == s[pre + 2]) {
re += s.substr(pre, pos - pre);
re += s.substring(pre, pos);
in_code_block = true;

@@ -43,6 +43,6 @@ pre_empty_line = false;

const re_last_crlf_front = re.lastIndexOf(CRLF);
if (3 <= re_last_crlf_front && "<br>" == re.substr(re_last_crlf_front - 3, 4)) {
if (3 <= re_last_crlf_front && "<br>" == re.substring(re_last_crlf_front - 3, re_last_crlf_front + 1)) {
re.erase(re_last_crlf_front - 3, 4);
}
re += s.substr(pre, pos - pre);
re += s.substring(pre, pos);
pre_empty_line = true;

@@ -52,13 +52,13 @@ }

else if (3 <= pos - pre && 1 < crlf_front && " " == s[crlf_front - 2] && " " == s[crlf_front - 1]) {
re += s.substr(pre, crlf_front - 2 - pre);
re += s.substring(pre, crlf_front - 2);
re += "<br>";
re += s.substr(crlf_front, pos - crlf_front);//add CRLF
re += s.substring(crlf_front, pos);//add CRLF
pre_empty_line = false;
}
else {
re += s.substr(pre, pos - pre);
re += s.substring(pre, pos);
pre_empty_line = false;
}
}
re += s.substr(pre);
re += s.substring(pre);
return re;

@@ -65,0 +65,0 @@ }

{
"name": "gitbook-plugin-markdown-parse-add-br",
"version": "1.0.3",
"version": "1.0.4",
"description": "A GitBook plugin to support newline in paragraph.",

@@ -23,5 +23,5 @@ "author": "yumetodo <yume-wikijp@live.jp> (https://github.com/yumetodo)",

"devDependencies": {
"ava": "^0.15.2",
"ava": "^0.16.0",
"colors": "^1.1.2",
"diff": "^2.2.3"
"diff": "^3.0.0"
},

@@ -28,0 +28,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc