Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@deskeen/markdown

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deskeen/markdown - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

5

CHANGELOG.md
# Changelog
## 5.1.1 - 2021-05-27
**🐛 Bugfix**
- Several bold/italic words can be added to a single line.
## 5.1.0 - 2021-05-20

@@ -4,0 +9,0 @@

2

package.json
{
"name": "@deskeen/markdown",
"version": "5.1.0",
"version": "5.1.1",
"description": "Node.js Markdown to HTML Parser",

@@ -5,0 +5,0 @@ "author": "Morgan Schmiedt",

@@ -519,13 +519,15 @@ 'use strict'

const remainingText = lineText.substring(lineCursor)
const syntaxMatch = /^(\*{1,3})/.exec(remainingText)
const syntax = syntaxMatch[0]
const syntaxSize = syntax.length
const nextChar = remainingText[syntaxSize]
const match = /^(\*{1,3})(.*?\S)(\*{1,3})/
.exec(remainingText)
if (isSpace(nextChar) === false) {
const endMatch = /(.+?)(?=\S\*)/
.exec(remainingText.substr(syntaxSize))
if (match) {
const syntaxOpen = match[1]
const syntaxSize = syntaxOpen.length
const content = match[2]
const syntaxClose = match[3]
const firstContentChar = content[0]
if (endMatch) {
const endTagIndex = endMatch[0].length + syntaxSize + 1
if (syntaxOpen === syntaxClose
&& isSpace(firstContentChar) === false) {
const endTagIndex = syntaxSize + content.length

@@ -535,3 +537,3 @@ flush()

if (syntax === '*') {
if (syntaxOpen === '*') {
const emNode = document.createElement('EM')

@@ -542,3 +544,3 @@ emNode.ffOnTextEnd = syntaxSize

targetNode = emNode
} else if (syntax === '**') {
} else if (syntaxOpen === '**') {
const strongNode = document.createElement('STRONG')

@@ -563,5 +565,5 @@ strongNode.ffOnTextEnd = syntaxSize

}
ff = syntaxSize
}
ff = syntaxSize
}

@@ -568,0 +570,0 @@ } else if (char === '~') {

@@ -81,2 +81,10 @@ 'use strict'

test('2 Emphasis on the same line', function (t) {
const input = 'A *1* and a *2*.'
const output = '<p>A <em>1</em> and a <em>2</em>.</p>'
t.equal(parseToHtml(input), output, 'Output is valid')
t.end()
})
test('Emphasis with wrong end tag inside: space+*', function (t) {

@@ -83,0 +91,0 @@ const input = 'An *italic *tes t* text'

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