Skip to content

Commit

Permalink
Remove superfluous push to delimiter stack in handleDelim
Browse files Browse the repository at this point in the history
A clause in the condition gating whether to add a parsed
' or " to the delimiter stack *always* evaluated to TRUE.
What is clearly a typo happened to not break any tests
and *probably* only wasted a bit of memory and CPU.

This commit reflects what I believe to be the original
intention: Only add ' and " if smart quotes is enabled.
  • Loading branch information
vassudanagunta authored and jgm committed Apr 9, 2020
1 parent 98c25ab commit fc797cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/inlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ var handleDelim = function(cc, block) {
// Add entry to stack for this opener
if (
(res.can_open || res.can_close) &&
(this.options.smart || cc !== C_SINGLEQUOTE || cc !== C_DOUBLEQUOTE)
(this.options.smart || (cc !== C_SINGLEQUOTE && cc !== C_DOUBLEQUOTE))
) {
this.delimiters = {
cc: cc,
Expand Down

0 comments on commit fc797cf

Please sign in to comment.