forked from commonmark/commonmark.js
-
Notifications
You must be signed in to change notification settings - Fork 12
/
changelog.txt
666 lines (614 loc) · 31 KB
/
changelog.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
[0.30.0]
* Update tests to 0.30 spec.txt.
* Fix commonmark/cmark#383. Our optimization for emphasis parsing
was flawed, leading to some corner cases where nested emphasis was
parsed incorrectly.
* Allow user to specify a function to escape the output (#217, newfivefour).
* Simplify `reThematicBreak`.
* Fix documentation for `node.listType` (TheWastl). The parser produces
lowercase strings, but the README said the strings are capitalized.
* Fix handling of type 7 HTML blocks (#213).
They can't interrupt paragraphs (even with laziness).
* Fix link label normalization with backslash before newline (#211).
* Only match punctuation at the beginning of the string (Vladimir Pouzanov).
This makes the punctuation use match `reUnicodeWhitespaceChar` usage
in `scanDelims`. It's effectively a no-op, as `char_after` is expected
to only contain a single character anyways.
* Recognize '01' as start number 1 (#207).
* Use rollup `--banner` to include license info.
* Remove dist files from the repository. Instead we now generate them
with pretest and prepublish scripts.
* Simplify dingus Makefile.
* Fix an iframe loading timing issue in the dingus (icyrockcom).
Closes commonmark/commonmark-spec-web#15.
[0.29.3]
* Fix some rough edges around ES modules (Kyle E. Mitchell)
(#195, #201, #203):
+ Set module types via package.json files in subdirectories.
A number of JavaScript files were rewritten as ES
Modules, but their extensions remained `.js`. That
extension is ambiguous to newer version of the Node.js
runtime, which can load both CommonJS modules and ES
Modules. To fix this, we add `package.json` files with
`type` properties to the various subdirectories. Setting
`type` to `"module"` tells Node.js to interpret `.js`
files in that directory and below as ES Modules.
Otherwise, Node.js falls back on the `package.json` at
root, which currently sets `type` to `"commonjs"`.
+ Make benchmark and test use commonjs again.
+ bin: remove use of ESM and use `require('../')`.
Node.js version 14, which supports ES Modules without any flag or the
`esm` package, is currently in long-term support. But a great many
folks still run older version of Node.js that either don't support ES
Modules at all or hide that support behind a feature flag.
+ Import specific functions from `entities` package.
+ Update "Basic Usage" comment in `lib/index.js`.
* Remove package-lock.json (Kyle E. Mitchell).
* Fix 'make test' target so that dist is built.
* `reHtmlTag`: don't use case-insensitive matching (#193).
The spec specifies uppercase for declarations and CDATA.
* Handle piped input from stdin in windows. Use file descriptor 0
instead of '/dev/stdin'. Note that this allows piping but doesn't
handle the case where users run `bin/commonmark` and enter input
directly. See #198 for some relevant discussion.
* Configure GitHub Actions to test on Node.js 14 and 15 (Kyle E. Mitchell).
* Allow EOL in processing instructions (#196).
[0.29.2]
* Use ES modules (Iddan Aaronsohn).
* Improve and simplify reference link normalization (#168).
We now use the built in `str.toLowerCase().toUpperCase()`, which
@rlidwka has shown does an accurate unicode case fold.
This allows us to remove a huge lookup table and should
both decrease the size of the library and speed things up.
* Fix end source position for nested or indented fenrced code blocks.
Improves on earlier fix to #141, which only worked for code blocks
flush with the left margin.
* Upgrade to entities 2.0+.
* Fix generation of dist files for dingus.
* Use esm for bin/commonmark, bench, test.
* Use rollup uglify plugin to create minified dist.
* Move dev dependencies to proper place in package.json.
* Use rollup instead of browserify (Iddan Aaronsohn).
* Reformat code with prettier (Iddan Aaronsohn).
* Replace travis CI with GitHub Actions CI.
* Bump versions of software to benchmark against.
* Change jgm/commonmark.js to commonmark/commonmark.js (#126).
* Security audit fixes.
* Remove obsolete spec2js.js script
* Remove test on node 9 and under. Only support actively maintained
versions.
* Run npm lint in ci.
[0.29.1]
* Export `Renderer` (#162, Federico Ramirez). Export the `Renderer`
class so consumers can use it as a base class for their own custom
`Renderer`'s. [API change]
* Fix end source position for fenced code and raw HTML (#141).
* Ensure that `\` is treated as punctuation character (#161).
* Remove redundant token from `reHtmlBlockOpen` (Vas Sudanagunta).
* Remove unused variable `reWhitespace`.
* Don't decode url before encoding it again (Daniel Berndt).
* Don't allow link destinations with unbalanced unescaped parens (#177).
* Don't put quote delims on stack if not `--smart`.
* Don't add to delim stack if `!can_open && !can_close` (#172).
* Remove no longer used argument to `escapeXml` (#169, Robin Stocker).
* Avoid numerical conversion for file names in argv (#164, Alex Kocharin).
* Adapt existing encoding-based regression test and add `%25`-based
regression test (Daniel Berndt).
* Add pathological test for #172 illustrating quadratic time bug.
* Fix pathological case commonmark/cmark#178.
* Add pathological test for cmark#178.
* Dingus: remove debugging console.log.
* Sync `.editorconfig` `indent_size` to actual (#178, Vas Sudanagunta).
* Add lint rule for unused variables
* Apply npm audit suggestions.
* Fixed invalid package.json dependency entries (Vas Sudanagunta).
[0.29.0]
* Update spec to 0.29.
* Fix parsing of setext headers after reference link definitions.
* Fix code span normalization to conform to spec change.
* Allow empty destinations in link refs. See commonmark/commonmark#172.
* Update link destination parsing.
* dingus: add dependency version requirements (#159, Vas Sudanagunta).
Dingus was rendering incorrectly with Bootstrap 4. Added a bower.json
which requires Bootstrap, jQuery and Lodash with major version equal
to what's currently live. Likewise the minimum patch version.
* package.json: Add version for bower in devDependencies.
* package.json - use `^` operator for versions.
* Allow internal delim runs to match if both have lengths that
are multiples of 3. See commonmark/commonmark#528.
* Remove now unused 'preserve_entities' option on escapeXml.
This was formerly used (incorrectly) in the HTML renderer.
It isn't needed any more. [API change]
* html renderer: Don't preserve entities when rendering
href, src, title, info string. This gives rise to double-encoding errors,
when the original markdown is e.g. `:`, since the commonmark
reader already unescapes entities. Thanks to Sebastiaan Knijnenburg for
noticing this.
* More efficient checking for loose lists.
This fixes a case like commonmark/cmark#284.
* Disallow unescaped `(` in parenthesized link title.
* Add pathological test (commonmark/cmark#285).
* Comment out failing pathological test for now.
* Add pathological tests for #157.
* Fix two exponential regex backtracking vulnerabilities (#157,
Anders Kaseorg). ESCAPED_CHAR already matches `\\`, so matching it again
in another alternative was causing exponential complexity explosion.
This makes the following behavior changes:
`[foo\\\]` is no longer incorrectly accepted as a link reference.
`<foo\>` is no longer incorrectly accepted as an angle-bracketed
link destination.
* package.json: require lodash >= 4.17.11.
* Require cached-path-relative >= 1.0.2.
This fixes a security vulnerability, but it's only
in the dev dependencies.
* Update fenced block parsing for spec change.
* Require space before title in reference link.
See commonmark/cmark#263.
* Update code span normalization for spec change.
* Removed meta from list of block tags. See commonmark/CommonMark#527.
* make dist: ensure that comment line is included in dist files (#144).
Also change URL to CommonMark/commonmark.js.
* Use local development dependencies (#142, Lynn Kirby).
Packages used during development are now listed in devDependencies of
package.json. Makefiles are updated to use those local versions.
References to manually installing packages are removed from README.md
and bench/bench.js. The package-lock.json file used in newer NPM
versions is also added.
* Allow spaces in pointy-bracket link destinations.
* Adjust max length for decimal/numeric entities.
See commonmark/CommonMark#487.
* Don't allow escaped spaces in link destination.
Closes commonmark/CommonMark#493.
* Don't allow list items that are indented >= 4 spaces.
See commonmark/CommonMark#497.
[0.28.1]
* Update changelog (omitted from 0.28.0 release).
[0.28.0]
* Update spec to 0.28.
* Align punctuation regex with spec (#121). Previously some ASCII
punctuation characters were not being counted, so `^_test_` came out
without emphasis, for example.
* Simplified a logical test, making it closer to the wording of the spec.
* Don't parse reference def if last `]` is escaped (#468).
E.g.
[\ ]
[\]: test
* Dingus Makefile: remove ref to obsolete html.js.
* Removed obsolete lib/xml.js (replaced by lib/render/xml.js).
* Allow tabs before and after ATX closing header (Erik Edrosa).
* Change precedence of Strong/Emph when both nestings possible.
This accommodates the spec change to rule 14.
Note that commonmark.js was not previously in conformity
with rule 14 for things like `***hi****`.
* Calculate "mulitple of 3" for delim runs based on original number
of delims, not the number remaining after some have been
used.
* Make esc() method abstract and overridable (muji).
* README: update documentation for overriding softbreak and esc (#118).
* Remove old XMLRenderer implementation (muji).
* package.json: use shorter form for repository.
* Don't export version in lib/index.js.
Instead, users can get version from package.json:
`require('commonmark/package.json').version`.
* Removed remnants of old html renderer (#113).
Now we use lib/renderer/html.js.
* Hand-rolled parser for link destinations.
This allows nested parens, as now required by the spec.
* Fix regression test example (Colin O'Dell).
* dingus: Fixed iframe on load.
[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 jgm/CommonMark#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 jgm/CommonMark#430).
* Enforce spec's distinction between Unicode whitespace and regular whitespace
(Timothy Gu, see jgm/CommonMark#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.
* Update README.md on overriding softbreak and escaping in
renderer (#118).
[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.
* 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
to `count`.
* 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).
[0.25.1]
* Ensure that `advanceNextNonspace` resets `partiallyConsumedTab`.
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.
[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.
[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.
[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 from `libcmark`.
* Fixed a list/tab/padding corner case (#59).
* Escape HTML contents in xml output, as the DTD requires PCDATA.
* xml renderer - added xmlns attribute (jgm/CommonMark#87).
* Test on node.js 5.x and 4.x (Nik Nyby). Remove testing on iojs.
* Initialize `_listData` to `{}` when creating `Node` (#74).
* Added version check for uglify; updated dist files (#69).
* Fix typo in breakOutOfLists description (Nik Nyby).
* Updated benchmarks in README.md.
[0.22.1]
* README: Use an https URL for commonmark.js (#71).
* README: Fixed typo (#70).
* Reset `container` after closing containing lists (#67).
* Use mdurl 1.0.1, to avoid problems with Google closure
compiler (#66).
* Adjusted .npmignore so the package doesn't include
extraneous files (#72, Hypercubed).
[0.22.0]
* Added `iframe` to whitelist of HTML block tags (as per spec).
* Removed `pre` from rule 6 of html blocks (see jgm/CommonMark#355).
* Fixed logic error in calculation of offset. Here's a test case this
fixes:
```
% echo -en "1. \t\tthere" | bin/commonmark
<ol>
<li>
<pre><code>ere
</code></pre>
</li>
</ol>
```
* Disallow list item starting with multiple blank lines
(jgm/CommonMark#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.
[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 jgm/CommonMark#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
the `inlineParser`.
* Properly split on whitespace in HTML renderer (#54).
* Fixed bench for new version of showdown (soomtong).
* `processEmphasis`: renamed `potential_openers` -> `openers_bottom`,
better logic for setting lower bound in `openers_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` and `advanceOffset` functions.
* Removed `detabLine` and tabs-to-spaces conversion.
* Added `column` and `nextNonspaceColumn` to parser.
Adjust these in `findNextNonspace`.
* 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 copied `encode.js`, `decode.js`.
* Use `entities` from npm instead of `html5-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.
[0.20.0]
* Ensure that link labels contain non-whitespace (jgm/CommonMark#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 (jgm/CommonMark#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:
```
<div
class="foo">
```
* 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.
[0.19.0]
* Fixed underscore emphasis to conform to spec changes
(jgm/CommonMark#317, #12).
* Fixed variable shadowing (linter warnings) in `test.js`.
* Makefile: Moved `lint` first to avoid regenerating `dist` by accident.
* Dingus: Fixed word wrapping in text area (jgm/CommonMark#319).
* Updated `spec.txt` in `test/`.
* Added `release_checklist.md`.
[0.18.2]
* Fixed walker so that it stops at `this.root`, even when this is
not the document root.
* Fixed typo (Ed Adams).
* Removed unused argument from `processEmphasis` (Robin Stocker).
* Shortened code for removing a sequence of delimiters, changing the
links on the edges rather than dropping them one by one
(Eli Barzilay).
* Code layout improvements for readability (Eli Barzilay).
* Dingus: rewrote without ACE editor for better accessibility
and to fix layout in smal windows (#11).
* Optimize checking for final spaces in `parseNewline` (Robin
Stocker). This yields a 5-10% speed improvement in `make bench`.
* Consolidated regex definitions (Robin Stocker).
* Return boolean from `spnl` and `parseBackticks` for consistency
(Robin Stocker).
* Removed unnecessary check for hrule in `parseListMarker` (Robin
Stocker).
* Return error status if tests fail.
* Use `encode`/`decode` from markdown-it/mdurl for URL
normalization. This fixes cases like `[link](http://google.com/?q=%3f)`
which was formerly wrongly converted to
`<a href="http://google.com/?q=%253f">link</a>` (#9).
* Refactored `test.js`, adding `smart_punct` tests from cmark, and
factoring out `specTest` function.
* Make unmatched double quotes left quotes with `smart_punct` (#14).
* Code cleanup in `finalize`.
[0.18.1]
* Updated `dist/commonmark.js`.
[0.18.0]
* Added `nextNonspace`, `blank`, `indent` properties to `Parser`.
* Factored out advance-to-nonspace code into `findNextNonspace`.
* Put block starts into `blockStarts` property of `Parser`. Now
almost all block-specific material has been moved out of
`incorporateLine`.
* Removed parameter from `addLine`.
* Simplified code, removed `matchAt`.
* Small optimization in `entityToChar`
* Use `charCodeAt` in a few places where `charAt` was used.
* Added `peek()` function in blocks. This ensures we check bounds
before calling `charCodeAt`.
* Use `peek` instead of raw `charCodeAt` in `inlines.js`.
* Dingus improvements:
+ Use ACE editor in dingus. Implemented L->R sync scroll. Also,
the block containing the cursor is highlighted on the right.
+ Split code from `dingus.html` into separate file `dingus.js`.
+ Split CSS into separate file, `dingus.css`.
+ Added debounce.
+ Moved dingus code to `dingus/` directory. `dingus/Makefile`
builds `commonmark.js` in the dingus directory. So to deploy,
you just need to copy the dingus directory.
+ Use local copies of js dependencies. Instead of including these in
the repository, though, we have the Makefile install them with bower.
+ Fixed one-off error in line number calculation.
+ XML and HTML are now same font size.
+ Allow line wrapping in editor.
+ AST window now scrolls like HTML window.
* Updated `reNonSpace` for new whitespace definition in spec.
* Added smart punctuation parsing option.
+ Added `options` param to InlineParser. `options.smart` triggers
smart punctuation parsing.
+ Added `--smart` option to bin/commonmark.
+ Implemented "smart" parsing of dashes, ellipses, quotes. The
algorithm is the same as in cmark.
+ Renamed `handleEmphasis` -> `handleDelims`.
+ Added benchmark with `smart`.
+ Added checkbox for `smart` to dingus.
* Fixed code example for walk.
* Made `isContainer` a getter to conform to README (#7).
* Allow list start number of 0 in HTML writer (#10).
* Fixed use of `isContainer` in XML writer.
`isContainer` is now a getter, not a function.
[0.17.1]
* Reorganized block parsing in a more modular way. There is now
a `blocks` property of the parser that contains information
about each type of block, which is used in parsing. Ultimately
this will make it easier to extend the library, but the project
is still only partially completed.
* Code cleanup and simplification, with some performance optimizations.
* Removed version from `bower.json`. Bower takes version from tags.
* Initialize some properties at beginning of 'parse'.
This fixes some mistakes in source position when the
same Parser object was used to parse multiple times (#3).
* Made parsing of backslash escapes a bit more efficient.
* Removed refmap parameter of InlineParser.parse().
Instead, set the refmap property before running the parser.
* Set `_string_content` to null after using, allowing it to be GCd.
* Removed `_strings`; just append to `_string_content`.
This gives better performance with v8.
* Format benchmarks so that samples are linked.
* Added in-browser benchmark.
* Added API documentation to README.
* xml renderer: use `sourcepos` attribute, not `data-sourcepos`.
* Changed license to 2-clause BSD. Added clause for spec.
[0.17.0]
* Renamed `DocParser` -> `Parser`.
Note: library users should update their code or it will break.
* Added `normalize-reference.js`. This does a proper unicode case
fold instead of just using `toUpperCase`. It is also faster,
partly because we can do one pass for space and case normalization.
* Removed artificial distinction btw FencedCode, IndentedCode
in `blocks.js`.
* Removed vestigial `ReferenceDef` node type.
* Added getters and (in some cases) setters for "public" properties
of Nodes. Renamed non-public properties to start with underscore.
This will allow us to keep the API stable while changing the
underlying data structure. And it will avoid exposing properties
that have only an instrumental value in parsing.
* Removed `Node.toObject()`.
* Rename `bullet_char` -> `bulletChar`.
* Check for blank line before checking indent in Item.
* Removed unnecessary setting of default `tight=true` in `finalize`.
We do that when the `listData` object is initialized.
* Performance optimization - avoid repeating scan for nonspace.
* Moved check for closing fence to close-block-check section.
This is a more logical arrangement and addresses jgm/CommonMark#285.
* Added `offset` property to `DocParser`. Use this in `addLine`,
instead of `offset` parameter, which has been removed.
* Implemented new spec for emphasis and strong emphasis with `_`.
* `html.js` - explicitly specify second parameter of `escapeXml`.
* Fixed escaping error in CDATA regex.
* Removed some dead code and fixed incorrect call to `addChild`
with three arguments (Robin Stocker).
* Adjust `lastLineLength` before returning after close fence.
* Propagate `lastLineBlank` up through parents.
Previously we just kept it set on the bottom child.
But this will give a quicker determination of `lastLineBlank`.
* Moved continuation checks & finalizers into `blocks` property
of `Parser`. This is a first step towards keeping the code for
each kind of block in a central place, rather than spread all over
the code base. This is preparatory for a more modular structure,
where each type of block has a record describing how it is parsed and
finalized. Eventually this will also contain functions for checking for
a block start, and metadata that determines how line data
should be handled.
* Added `currentLine` property to `Parser`.
* Renamed `first_nonspace` -> `next_nonspace`.
* Put generated `commonmark.js` in `dist/` rather than `js/`.
* Miscellaneous code cleanup.
* Split JS code into (this) independent repository.
* Added detailed benchmark with samples (`make bench-detailed`).
* Added `dist/commonmark.js` to repo (for bower).
* Added `bower.json` (jgm/CommonMark#288).
* Updated test suite. Now shows how performance depends on length in
pathological cases.
* Don't use -1 as second param for .slice. This seems to cause a
deoptimization, as reported by `node --trace-deopt`.
* Added `CONTRIBUTING.md`.
* Added `.travis.yml` to test against various node versions.
* Renamed `changelog.js.txt` -> `changelog.txt`.
[0.16]
* Improved regex for HTML comments (#263).
* Fixed CDATA regex (#267).
* Use linked list instead of arrays in AST: the same doubly linked
node structure as cmark uses. This simplifies some code and
eliminates the need for recursive algorithms, so we can render
deeply-nested structures without stack overflows.
* Use `children` instead of `label` (in Image and Link),
`inline_content` (in Paragraph), and `c` (in Emph and Strong).
* Renamed the `c` property to `literal` to match `libcmark`.
* Use `literal` rather than `string_content` property for code
blocks, HTML. `string_content` is reserved for raw string
content that has yet to be parsed as inlines.
* Improved end lines (#276).
* Added a node walker, for easy AST traversal (see `node.js`).
* Regularized position information into a `sourcepos` property.
Added end column information.
* Renamed `html-renderer.js` to `html.js`.
* Replace NUL characters with U+FFFD, as per spec.
* Optimized code, resulting in significant performance gains.
(We've gone from being twice as fast as showdown.js to being
three times as fast, on par with marked.)
* Made `tight` a property of `list_data` rather than `Node`.
* Added options to renderer, parser objections.
* Added a `--sourcepos` command line option to `js/bin/commonmark`.
* HTML renderer now throws an error on unknown tag type (which
indicates a programming error).
* Removed `ansi.js` code from the source tree. The test suite now
uses its own mini ansi colors implementation.
* Added `--time` option to `js/bin/commonmark`.
* Added an XML renderer (XML representation of the AST, matching
`Commonmark.dtd`).
* Changed `url` property to `destination` to match `cmark` and spec.
* Added `js/common.js` to hold some common code, like string
unescaping and URI normalization.
* Use `decodeURI` instead of `unescape`.
* Added some "pathological" test cases to test suite.