Releases: commonmark/commonmark.js
commonmark.js 0.27.0
- Update spec to 0.27.
- Use correct name in DOCTYPE declaration for XML output.
It should be document, not CommonMark. - Fix Node type names in README (Jan Marthedal Rasmussen).
- Allow shortcut link before a
(
. See commonmark/commonmark-spec#427. - Added all characters in Pc, Pd, Pe, Pf, Pi, Po, Ps to rePunctuation
(#108, problem not recognizing East Asian punctuation). - Allow tab after setext header line (#109).
- Recognize h2..h6 as block tags (see commonmark/commonmark-spec#430).
- Enforce spec's distinction between Unicode whitespace and regular whitespace
(Timothy Gu, see commonmark/commonmark-spec#343). Per ECMA-262 6th Edition
("ECMAScript 2015") §21.2.2.12 [CharacterClassEscape], the JavaScript\s
escape character matches the characters specified by "Unicode whitespace,"
but not "whitespace." Rename the existing regular expression variable to
UnicodeWhitespace
, and create and use a new regular expression variable
that only matches the limited set of "whitespace" characters. - Removed unused definition.
commonmark.js 0.26.0
-
Implemented spec changes to lists:
- Don't allow ordered lists to interrupt a paragraph unless
they start with 1. - Remove two-blanks-break-out-of-lists feature.
- Blank list item can't interrupt paragraph.
- Don't allow ordered lists to interrupt a paragraph unless
-
Fixed minor regex bug with raw HTML blocks (#98).
This would affect things like:<a>[SPACE][SPACE] x
which, with the change, gets parsed as a raw HTML block, instead of a
single paragraph with inline HTML, a line break, and 'x'. The new
behavior conforms to the spec. See #7 in 4.6. Added regression. -
Remove unnecessary check (Nik Ryby). It looks like
columns
is always
true in this block, so there's no need to check it during the assignment
tocount
. -
Simplify and optimize brackets processing (links/images) (Robin Stocker).
Together, these changes make the "nested brackets 10000 deep"
pathological case go from 400 ms to 20 ms. -
Changes in emph/strong emph parsing to match changes in spec.
This implements the rule that we can't have emphasis matches
when (a) one of the delimiters can open AND can close, and (b)
the sum of the lengths of the delimiter runs containing open
and close delimiters is a multiple of 3. -
Fix not existing property usage (Maksim Dzikun).
-
Fixed tabs in ATX headers and thematic breaks.
-
Remove unused write-only variable (Maksim Dzikun).
commonmark.js 0.25.1
- Ensure that
advanceNextNonspace
resetspartiallyConsumedTab
.
This fixes a regression in which the first character after a tab
would sometimes be dropped. - Added regression tests.
- XML renderer: escape attribute values (muji).
- Fix dingus vulnerability (muji). Use an iframe and innerHTML to prevent
<script>
tags from executing. - Dingus: let preview show when query has
text=
. Previously we had
these URLs open the HTML pane first, but now that we have XSS protection
(the iframe), it should be okay to open the preview pane first. - Dingus: don't print sourcepos attributes in HTML/AST view.
commonmark.js 0.25.0
- [API change] Added abstract renderer; adjusted HTML renderer to use
its prototype (muji, jgm). - Fix tabs in list indentation (#86). This fixes
advanceOffset
to better handle cases where a list indent doesn't consume all of
the virtual spaces represented by a tab. - Proper tab handling with blockquotes, fenced code, lists.
- Fixed handling of partially consumed tabs.
- Fixed logic bug with blank line after empty list item (#78).
- Ensured render directory is installed by npm (muji).
- Better ECMAScript 5 style inheritance (muji).
- Don't require sudo for make bench.
- Added command line usage (Daniel Baird).
- Brought CLI options in line with cmark. Now you say
-t xml
instead of--xml
. - Use minima for cli option parsing, add
--help
(#81). - Tweaked description of commonmark program. Now that we have
--help
we can forego a detailed description of options.
commonmark.js 0.24.0
- [API change] Added version.
- Added
--version
to cli program. - Updated spec.txt to 0.24.
- Updated test runner to new spec format.
- Allow multiline setext header content.
- Don't allow spaces in link destinations, even in
<>
. - Updated recognizer for absolute URIs...
We no longer use a whitelist of valid schemes. - Remove unused variable
markerStartCol
(Nik Nyby). - Fix inaccurate comment about
closeUnmatchedBlocks
(Nik Nyby).
This function is void, and doesn't return true.
commonmark.js 0.23.0
- [API change] Rename nodes: "Html" -> "HtmlInline" (#63).
- [API change] Add
CustomBlock
,CustomInline
. - [API change] Rename "HorizontalRule" -> "ThematicBreak".
- [API change] Rename "Header" -> "Heading" (spec change).
- Don't allow whitespace between link text and link label
of a reference link (spec change.) - Fixed calculation of list offsets (#59).
- Allow tab after bullet list marker (#59).
advanceOffset
- copy the code fromlibcmark
.- Fixed a list/tab/padding corner case (#59).
- Escape HTML contents in xml output, as the DTD requires PCDATA.
- xml renderer - added xmlns attribute (commonmark/commonmark-spec#87).
- Test on node.js 5.x and 4.x (Nik Nyby). Remove testing on iojs.
- Initialize
_listData
to{}
when creatingNode
(#74). - Added version check for uglify; updated dist files (#69).
- Fix typo in breakOutOfLists description (Nik Nyby).
- Updated benchmarks in README.md.
commonmark.js 0.22.1
commonmark.js 0.22.0
- Added
iframe
to whitelist of HTML block tags (as per spec). - Removed
pre
from rule 6 of html blocks (see commonmark/commonmark-spec#355). - Fixed logic error in calculation of offset. Here's a test case this
fixes:
`
% echo -en "1. \t\tthere" | bin/commonmark-
ere
-
- Disallow list item starting with multiple blank lines
(commonmark/commonmark-spec#332). - Fixed bug in list-start parser (#60).
- Changed smart quote algorithm to agree with cmark (#61). The change only
involves double quotes, which now need to be both left flanking and
not right flanking to count as "can open." - Fix replacement of multiple apostrophes in the same paragraph with
--smart
(Brandon Frohs). make bench
: renice to -10 rather than 99.
commonmark.js 0.21.0
- Updated to version 0.21 of spec.
- Implemented
safe
option. This suppresses output of raw
HTML and potentially unsafe URLs. - Documented
smart
option. - Allow non-initial hyphens in html tag names.
This allows for custom tags, which in HTML5 MUST contain
a hyphen. See commonmark/commonmark-spec#239. - Revised HTML block parsing to conform to new spec.
- Imposed 9-digit limit on ordered list markers, per spec.
- Improved
smart_punct.txt
tests, and added some commentary
(a proto-spec). - Improved
smart
handling of dashes. We now process
whole strings of hyphens in such a way as to ensure that
we don't get a mix of hyphens and em and en dashes (#56,
Brandon Frohs). - Dingus: Removed duplicated CSS line (Aurelio Jargas).
- Dingus: Make permalink record whether 'smart' was selected (#55).
- Dingus: Removed Makefile dependency on
html5-entities.js
. - Reset options before calling
inlineParser
.
Otherwise, if the main parser's options have changed since
it was instantiated, the new options won't be visible to
theinlineParser
. - Properly split on whitespace in HTML renderer (#54).
- Fixed bench for new version of showdown (soomtong).
processEmphasis
: renamedpotential_openers
->openers_bottom
,
better logic for setting lower bound inopeners_bottom
.- Fixed emphasis/link parsing bug (#50).
- Reset
this.column
on new parse. - Fixed test runner to handle visible tabs in spec HTML.
- Improved detection of column with tabs in input. Added
advanceNextNonspace
andadvanceOffset
functions. - Removed
detabLine
and tabs-to-spaces conversion. - Added
column
andnextNonspaceColumn
to parser.
Adjust these infindNextNonspace
. - Added note on README about how to fetch dependencies.
- Fix link reference definition edge case (Benjamin Dumke-
von der Ehe). If the reference seems to have a valid title
that does not go until the end of the line, check if the
reference becomes valid when discarding the title. - Fixed link label recognizer. Allow a backslash-escaped
backslash (#38). - Use
mdurl
instead of copiedencode.js
,decode.js
. - Use
entities
from npm instead ofhtml5-entities.js
. - Rewrote
findNextNonspace
for speed. - Remove delimiters as soon as we see that they don't match
anything (#43). This fixes a performance bug for things like
"a_ " * 20000
. - Improved efficiency of
processEmphasis
(#43). Don't look
for openers again when we've already searched for openers
of a certain type. - Allow literal (non-escaping) backslashes in link destinations
(Benjamin Dumke-von der Ehe). - Added several pathological tests (#43).
- Don't consider images to be self-closing in the XML writer
(Benjamin Dumke-von der Ehe). Image nodes in a CommonMark AST
are containers, and as such the XML writer will always output
a closing tag.
commonmark.js 0.20.0
-
Ensure that link labels contain non-whitespace (commonmark/commonmark-spec#322).
-
Strip brackets in
normalize-reference
. Otherwise the stripping
of leading/trailing whitespace doesn't work. For example:[hi] [ hi ]: url
-
Use U+FFFD for entities resolving to 0 (commonmark/commonmark-spec#323).
-
Fixed bug with list items indented >= 4 spaces (#42).
-
Extract regex test results in
scanDelims
as local variables
(Robin Stocker). Also, abort earlier when no delims where found. -
Allow a partial open block tag to be recognized when followed
by a newline with no space (#324). For example:
`` -
Added test for alternate line endings.
-
Added travis & npm buttons to README.md (Vitaly Puzrin).
-
Travis-CI: refresh node.js versions & use docker containers
(Vitaly Puzrin). -
Dingus css: set colors for textarea (#319). Otherwise we may run
into problems for people who have set their textarea default
colors.