1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
Commit Graph

776 Commits

Author SHA1 Message Date
Aidan Woods
726d4ef44a
Sanity checks before starting regex engine 2018-04-09 18:09:45 +01:00
Aidan Woods
450a74fedf
More expensive statement last 2018-04-09 18:09:45 +01:00
Aidan Woods
7e15d99d90
Remove regex from block rule 2018-04-09 18:09:44 +01:00
Aidan Woods
d2dd736e1b
Remove regex from fenced code block
Also remove unused function
2018-04-09 18:09:44 +01:00
Aidan Woods
e74a5bd7ed
In theory PHP stores the length of strings, so looking this up should be quick 2018-04-09 18:09:44 +01:00
Aidan Woods
b53aa74a72
Use standard library function 2018-04-09 18:09:44 +01:00
Aidan Woods
3ea08140b6
Remove use of array 2018-04-09 18:09:44 +01:00
Aidan Woods
c45e41950f
Use standard library over while loop 2018-04-09 18:09:44 +01:00
Aidan Woods
2faba6fef5
Remove unneeded complete function 2018-04-09 18:09:44 +01:00
Aidan Woods
b42add3762
Make some regexes possesive 2018-04-09 18:09:43 +01:00
Aidan Woods
107223d3a0
Avoid recomputation 2018-04-09 18:09:43 +01:00
Aidan Woods
d4f1ac465c
String interpolation is slightly faster than concat 2018-04-09 18:09:43 +01:00
Aidan Woods
d6e306d620
Optimise commonly used regexes to fail fast 2018-04-09 18:09:04 +01:00
Aidan Woods
dc5cf8770b
The AST has high complexity here (and so traversal is hard anyway)
We gain quite a bit of a speed boost by working with text here
since this is a very common function
2018-04-09 18:09:04 +01:00
Aidan Woods
70f5c02d47
Use non-nestable values as keys for O(1) lookup 2018-04-09 18:09:04 +01:00
Aidan Woods
90ad738933
General readability 2018-04-09 18:09:04 +01:00
Aidan Woods
f2327023c1
No need to unset if not set 2018-04-09 18:09:04 +01:00
Aidan Woods
6f13f97674
Use mutating loop instead of array_map 2018-04-09 18:08:58 +01:00
Aidan Woods
8091e5586a
Merge pull request #612 from aidantwoods/fix/table-columns
Table header should not be allowed to contain new lines
2018-04-09 16:53:07 +01:00
Aidan Woods
cb33daf0e6
Assert table header does not contain new lines 2018-04-09 16:38:03 +01:00
Aidan Woods
c440c91af5
Add failing test case 2018-04-09 16:32:36 +01:00
Aidan Woods
3514881e14
Merge pull request #611 from aidantwoods/enhancement/paragraph-block-semantics
Paragraph block semantics
2018-04-09 16:30:33 +01:00
Aidan Woods
043c55e4c6
Give paragraph block semantics for overloading 2018-04-09 15:12:17 +01:00
Aidan Woods
e4cd13350b
Remove setLiteralBreaks 2018-04-09 15:11:45 +01:00
Aidan Woods
ae8067e862
Swap undefined type for type === 'Paragraph' for ease of reading
The way in which we use this assumes that it is a paragraph, for example
appending text into the handler argument — so there is no loss of
generality here, we're simply being explicit.
2018-04-09 14:48:48 +01:00
Aidan Woods
5353ebb524
Avoid needing two arrays
We only need to collect elements, we can discard finished blocks
2018-04-09 14:48:39 +01:00
Aidan Woods
39df7d4f8e
Swap 'hidden' blocks for empty elements 2018-04-09 14:46:24 +01:00
Aidan Woods
50f15add44
Merge pull request #610 from aidantwoods/fix/lost-line-breaks
Fix lost line breaks
2018-04-09 14:19:38 +01:00
Aidan Woods
3f5b0ee781
Count number of interrupts 2018-04-09 14:13:10 +01:00
Aidan Woods
9a021b2130
Add failing test cases 2018-04-09 14:11:49 +01:00
Aidan Woods
43d25a74fe
Fix function name 2018-04-08 18:40:50 +01:00
Aidan Woods
1d68e5506c
Merge pull request #608 from aidantwoods/fix/recursion
Add seperate depth-first function instead of replacing recursive method
2018-04-08 18:02:17 +01:00
Aidan Woods
86940be224
Use mutating loop instead of creating new array 2018-04-08 17:49:36 +01:00
Aidan Woods
cdaf86b039
Add seperate depth-first function instead of replacing recursive method 2018-04-08 17:39:24 +01:00
Aidan Woods
1d65fb858a
Restore file permission to that of 1.7.1 2018-04-08 14:30:23 +01:00
Aidan Woods
600db7e4de
Bump version const to 1.8.0-beta-1 2018-04-08 02:46:30 +01:00
Aidan Woods
1be2a01de8
Merge pull request #607 from aidantwoods/update/readme-install-instructions
Update readme install instructions
2018-04-07 16:59:49 +01:00
Aidan Woods
f50ba3d803
Merge pull request #606 from erusev/revert-605-fix/this-php5.3-compat
Replace fix in "Explicitly capture $this for PHP 5.3"
2018-04-06 21:00:52 +01:00
Aidan Woods
387ef63888
Replace array reduce with foreach loop for PHP 5.3 compat 2018-04-06 20:55:27 +01:00
Aidan Woods
68be90348c
Revert "Explicitly capture $this for PHP 5.3" 2018-04-06 20:50:34 +01:00
Aidan Woods
48b9f71bdc
Merge pull request #605 from aidantwoods/fix/this-php5.3-compat
Explicitly capture $this for PHP 5.3
2018-04-06 20:44:32 +01:00
Aidan Woods
0039cd00f8
Explicitly capture $this for PHP 5.3 2018-04-06 20:40:25 +01:00
Aidan Woods
c6b717cc35
Merge pull request #604 from aidantwoods/fix/autobreak
Ensure autobreak false is honoured over empty name
2018-04-06 20:00:32 +01:00
Aidan Woods
8f3f61883d
Merge pull request #603 from aidantwoods/fix/recursion
Apply depth first
2018-04-06 19:57:55 +01:00
Aidan Woods
4c9ea94d0c
Apply depth first to avoid risk of segfault if closure creates subelements 2018-04-06 19:52:25 +01:00
Aidan Woods
32e69de014
Ensure autobreak false is honoured over empty name 2018-04-06 19:51:27 +01:00
Aidan Woods
201299ddc2
Merge pull request #602 from aidantwoods/enhancement/text-elements
Split some of `text` into `textElements`
2018-04-06 19:50:24 +01:00
Aidan Woods
557db7c179
Split some of text into textElements
`process` is no longer needed
2018-04-06 18:11:27 +01:00
Aidan Woods
0c0ed38290
Don't encourage downloading from master 2018-04-06 16:13:29 +01:00
Carsten Brandt
798bda682e Update README.md
updated installation instructions. fixes #242
2018-04-06 16:09:36 +01:00