summaryrefslogtreecommitdiff
path: root/js
AgeCommit message (Collapse)Author
2014-10-18Use browserify to make js code more modular.John MacFarlane
* Moved js library code to `js/lib`. * `js/stmd.js` is now generated from these files using browserify. * Factored out `html5-entities.js` and `from-code-point.js` from main js parsing code (which is now `index.js`). * Moved `js/markdown` to `js/bin`.
2014-10-07Changed bench.js so it no longer requires oldtests.John MacFarlane
2014-10-07Correct capitalization of JavaScriptBengt Lüers
2014-10-07stmd.js: Fixed entityToChar, adding fromCodePoint polyfill.John MacFarlane
Closes #151.
2014-10-07Reset label_nest_level before parsing reference.John MacFarlane
This fixes a bug with text like: [[some unrelated text [link] [link]: destination See #146.
2014-10-04Further emph fallback optimizations.John MacFarlane
2014-10-04Some jshint fixes.John MacFarlane
2014-10-04Use simpler algorithm.John MacFarlane
This handles things like `**hi***there*` and gives symmetrical treatment of `**hi*` and `*hi**`. Also handles the case from #147.
2014-10-02Revert "Use integers instead of strings for tags."John MacFarlane
This reverts commit ac611d51c9de9aa719b42b9463e6f28d6e7d74a4.
2014-10-02Revert "Use numerical constants."John MacFarlane
This reverts commit db25de09f5dc931c0e2b31ce0ccdb58052f3105f.
2014-10-02Use numerical constants.John MacFarlane
Performance optimization, but at cost of code clarity.
2014-10-02Use integers instead of strings for tags.John MacFarlane
Use === whenever possible to compare them.
2014-10-02Changed inline parsers to be monomorphic and modify inlines param.John MacFarlane
They all return true or false now, instead of the inlines parsed. Performance optimization.
2014-10-02Fixed rendering bug for blockquotes.John MacFarlane
2014-10-02Char code optimizations in block parsers.John MacFarlane
2014-10-02Eliminated unnecessary variable.John MacFarlane
2014-10-02Changed peek() to return char code.John MacFarlane
Test char codes instead of strings. Small optimization (about 1% speed boost).
2014-09-30Unescape entities as well as backslashes in titles, URLs.John MacFarlane
This way URLs with entities will be properly percent encoded as in the C implementation.
2014-09-30unescape URI before escaping.John MacFarlane
If we already have %-encoded characters in the URI, we want to preserve them.
2014-09-30Added entity decoding.John MacFarlane
AST now contains parses entities as Str objects with unicode characters, not as 'Entity'. (Like the new C parser.)
2014-09-29Rename unescape -> unescapeBS to avoid confusion with built-in.John MacFarlane
2014-09-29Escape URIs.John MacFarlane
2014-09-29Use charAt for browser compatibility.John MacFarlane
2014-09-26Only memoize during inline parsing.John MacFarlane
This cuts the performance hit. With memoization, we get roughly constant behavior in the fuzztest. Without it, not.
2014-09-26Restored memoization code.John MacFarlane
2014-09-26Used last_emphasis_closer to avoid unneeded scans for closer.John MacFarlane
This doesn't seem to help much.
2014-09-26Removed memoization code.John MacFarlane
2014-09-26Simple fallback if we don't match emphasis.John MacFarlane
The other approach led to wrong results on: *hi _there*
2014-09-24Fixed bug that causes hang on bare `<` inside link label.John MacFarlane
2014-09-17Use helper functions to simplify code.John MacFarlane
2014-09-16Revert "Re-added backtracking and memoization."John MacFarlane
This reverts commit ac8529c9f55da7fdc1186e3f34313cf411de6e71.
2014-09-16Re-added backtracking and memoization.John MacFarlane
Gives better results for things like **foo*
2014-09-16Small performance tweaks.John MacFarlane
2014-09-16Fixed bug in parsing `* **a** b*` etc.John MacFarlane
2014-09-16New parseEmphasis algorithm.John MacFarlane
- State machine for emphasis parsing. - This would require some adjustments to the spec and spec examples. - It currently blows the stack on `tricky'. - Memoization code has been commented out. - Inline parsers return arrays.
2014-09-11Fixed performance regression from eccc23dc8d.John MacFarlane
2014-09-11Fixed typo.John MacFarlane
starting
2014-09-11jshint improvements.John MacFarlane
2014-09-11Reindented source with js2-mode.John MacFarlane
2014-09-11Clarified code logic for last_emphasis_closer.John MacFarlane
2014-09-11Add check for null in last_emphasis_closer.John MacFarlane
2014-09-11Renamed last_closer -> last_emphasis_closer.John MacFarlane
2014-09-11Added last_closer to Inline object.John MacFarlane
This helps us avoid unneeded backtracking in pathological input of the form: *a **a *a **a *a etc. If we get to position k without finding a closing delimiter, then backtrack to 1, we can assume we won't find a closing delimiter when parsing forward again. This could no doubt be polished up, e.g. by making it sensitive to the kind of delimiter.
2014-09-11Fixed bug.John MacFarlane
2014-09-11Special-case ***xx*** as strong/em.John MacFarlane
2014-09-11Simplified parseEmphasis.John MacFarlane
2014-09-11Handle case with 4+ delimiters in a row.John MacFarlane
Spec says to skip these.
2014-09-11Fixed reMain regex for better performance.John MacFarlane
2014-09-11Fixed rewind on parseLabel.John MacFarlane
14 test failures now, all with emphasis. IN most of all of these cases, the examples in the spec seem to be mistakes, given what the spec says. More troubling, performance is down from around 220 to 83. This needs investigation.
2014-09-11Completed conversion to memoized strategy.John MacFarlane
Test suite runs, but many failures.