Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ typings/
.idea/
.DS_Store
dist/docs/
yarn.lock
25 changes: 14 additions & 11 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2067,17 +2067,20 @@ function attachTextToNodeSliceEmphasis( parentNode, textToEmphasis ){
if( currentCharacterIndex > 0
&& lineUnderscored[ currentCharacterIndex ] === '~'
&& lineUnderscored[ currentCharacterIndex - 1 ] === '~' ){
const textNode = new Text( expressionBuffer.slice( 0, expressionBuffer.length - 2 ),
convertDecorationLevelToMark( currentDecorationLevel, strikedThrough ) )
parentNode.content.add( textNode )

expressionBuffer = ''
strikedThrough = !strikedThrough
}


if( lineUnderscored[ currentCharacterIndex ] === '_' ){
let decorationToUse = convertDecorationLevelToMark( currentDecorationLevel, strikedThrough )
const text = expressionBuffer.slice( 0, expressionBuffer.length - 2);
if (text.length > 0) {
const textNode = new Text( text,
convertDecorationLevelToMark( currentDecorationLevel, strikedThrough ) )
parentNode.content.add( textNode )
}

expressionBuffer = ''
strikedThrough = !strikedThrough
}


if( lineUnderscored[ currentCharacterIndex ] === '_' ){
let decorationToUse = convertDecorationLevelToMark( currentDecorationLevel, strikedThrough )

if( expressionBuffer !== '' ){
const textNode = new Text( expressionBuffer, decorationToUse )
Expand Down
25 changes: 14 additions & 11 deletions source/adfEmphasisParsing.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,20 @@ function attachTextToNodeSliceEmphasis( parentNode, textToEmphasis ){
if( currentCharacterIndex > 0
&& lineUnderscored[ currentCharacterIndex ] === '~'
&& lineUnderscored[ currentCharacterIndex - 1 ] === '~' ){
const textNode = new Text( expressionBuffer.slice( 0, expressionBuffer.length - 2 ),
convertDecorationLevelToMark( currentDecorationLevel, strikedThrough ) )
parentNode.content.add( textNode )

expressionBuffer = ''
strikedThrough = !strikedThrough
}


if( lineUnderscored[ currentCharacterIndex ] === '_' ){
let decorationToUse = convertDecorationLevelToMark( currentDecorationLevel, strikedThrough )
const text = expressionBuffer.slice( 0, expressionBuffer.length - 2);
if (text.length > 0) {
const textNode = new Text( text,
convertDecorationLevelToMark( currentDecorationLevel, strikedThrough ) )
parentNode.content.add( textNode )
}

expressionBuffer = ''
strikedThrough = !strikedThrough
}


if( lineUnderscored[ currentCharacterIndex ] === '_' ){
let decorationToUse = convertDecorationLevelToMark( currentDecorationLevel, strikedThrough )

if( expressionBuffer !== '' ){
const textNode = new Text( expressionBuffer, decorationToUse )
Expand Down