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

197 Commits

Author SHA1 Message Date
Aidan Woods
7b0a9cda04 Transformations must return transformable renderables 2021-10-13 19:46:53 +01:00
Aidan Woods
05a47e7083 Complete docblock 2021-10-13 19:35:21 +01:00
Aidan Woods
e9dec33dc6 Replacing all function to TransformableRenderable 2021-10-13 19:26:07 +01:00
Aidan Woods
a9f41548d3 adding method for Container 2021-10-13 19:02:52 +01:00
Aidan Woods
71d9263664 Pass State to render stack closure 2021-10-13 18:50:04 +01:00
Aidan Woods
8fc49f6b0a Add TransformableRenderable capability 2021-10-12 21:58:24 +01:00
Aidan Woods
a48c451d6c Restrict autolinks to https 2021-10-12 18:21:17 +01:00
Aidan Woods
efaf20d005 Minor refactor to use type hints 2021-10-12 18:05:58 +01:00
Aidan Woods
c773305bc1 Add RenderStack
This is a special configurable that can be used to alter the
Renderable[] AST before output.
2021-10-12 00:06:51 +01:00
Aidan Woods
7d1b9ca562 Better autolinks
This doesn't follow gfm spec yet, work lifted from my code over
at
8505e2737e/src/Parsers/GitHubFlavor/Inlines/AutoLink.php

Fixes #505
Fixes #717
2021-10-11 20:09:57 +01:00
Aidan Woods
ca16d7573d Fix psalm errors 2021-10-11 19:23:44 +01:00
Aidan Woods
8764512c23 Add SlugRegister so IDs are not duplicated 2020-05-10 14:32:01 +01:00
Aidan Woods
4e99e29d28 Trim leading and trailing hyphens from slug 2020-05-10 14:32:00 +01:00
Aidan Woods
d8bf07535c Strip superscripts and divisions from eventual slug
As suggested by @Ayesh

Co-authored-by: Ayesh Karunaratne <ayesh@ayesh.me>
2020-05-10 14:32:00 +01:00
Aidan Woods
e332b4710a Add HeaderSlug configurable
Adds HeaderSlug configurable, with the option for the slug function
to be customised.

Co-authored-by: netniV <netniv@hotmail.com>
2020-05-10 14:31:55 +01:00
Aidan Woods
c835535176 Implement DefinitionBook as MutableConfigurable
This is a slightly more correct implementation, but perhaps not worth
the headache.
2020-05-10 14:19:05 +01:00
Aidan Woods
0ef406e6d2 Add MutableConfigurable
Hopefully I do not regret this...
2020-05-10 14:18:51 +01:00
Aidan Woods
2235e36a2c Use verb imperative to indicate method is non-mutating 2020-01-19 18:06:22 +00:00
Aidan Woods
a6c17f449e previousEmptyLines -> precedingEmptyLines 2020-01-19 17:15:02 +00:00
Aidan Woods
7610eacbf9 Fix uppercase typo 2020-01-19 15:36:53 +00:00
Aidan Woods
525b72349b Expensive operation last 2020-01-19 15:34:04 +00:00
Aidan Woods
39b8b04d33 Clarify sequential lines being tracked are empty 2020-01-19 15:32:51 +00:00
Aidan Woods
8d09320009 Compute on read optimisation for previousEmptyLines 2020-01-19 15:31:33 +00:00
Aidan Woods
a72455c78a Use ->toHtml over ->text 2020-01-19 15:26:48 +00:00
Aidan Woods
a2ea704a43 Use list type over int array 2020-01-19 15:23:58 +00:00
Aidan Woods
13932bca9a Simplify match logic 2020-01-19 15:09:44 +00:00
Aidan Woods
0a1e4bd802 Formatting fix 2019-09-09 23:33:06 +01:00
Aidan Woods
bfdd0f29bc More specific annotation 2019-09-09 23:27:36 +01:00
Aidan Woods
5db3687892 $matches is guarenteed to contain data for the full pattern 2019-09-09 23:26:21 +01:00
Aidan Woods
54f7719a08 Force return type to T
It's currently not a planned feature to allow Psalm to understand
the type relationship of class-name => class-instance as the array
here is constructed.
Ref: https://github.com/vimeo/psalm/issues/1969
2019-07-25 19:16:28 +02:00
Aidan Woods
211a7eb5aa Tables always acquire previous 2019-07-25 16:18:00 +02:00
Aidan Woods
37f306c3a8 Utilise constant arrays over static vars 2019-07-25 00:45:53 +02:00
Aidan Woods
ea55a9ffb0 Integer keys aren't necessary 2019-07-25 00:33:15 +02:00
Aidan Woods
34902bc80c Account for type 7 HTML blocks
These differ from type 6 blocks in a few ways (other than the HTML
element names given in the spec).

1. Type 7 blocks cannot interrupt paragraphs
2. Type 7 block must contain ONLY whitespace on the rest of the
   line, whereas type 6 blocks need only be followed by whitespace
   after the tag name, or have the opening tag be complete.
2019-07-25 00:22:09 +02:00
Aidan Woods
7b1389b48b More specific return type 2019-06-16 21:32:37 +01:00
Aidan Woods
9eb6a02334 Limit recursion depth by configurable
Fixes https://github.com/erusev/parsedown/issues/681
2019-04-07 17:34:40 +01:00
Aidan Woods
35d24d0b56 PHP < 7 patch 2019-04-07 16:38:46 +01:00
Aidan Woods
3f74fe8347 Port fix for https://github.com/erusev/parsedown/issues/699 into new
codebase
2019-04-07 16:38:46 +01:00
Aidan Woods
99525fdd76 Match GFM spec for extended autolinks
There is a small list of characters which may precede an autolink
2019-04-07 16:38:45 +01:00
Aidan Woods
33522f0aa4 Normalise link reference lookups
Ref: https://github.com/erusev/parsedown/pull/104
2019-04-07 16:38:19 +01:00
Aidan Woods
4adbd0b8a7 Backtracking capable inlines better expressed by interface 2019-04-07 16:38:19 +01:00
Aidan Woods
4501a094db Remove copy-pasto 2019-04-07 16:38:19 +01:00
Aidan Woods
4a215f33d4 Trim in renderer 2019-04-07 16:38:19 +01:00
Aidan Woods
3ccd64a9a1 Expand public API of Components
Ref: https://github.com/erusev/parsedown/issues/694
2019-04-07 16:38:19 +01:00
Aidan Woods
3c0b528d54 Constructor shouldn't be part of public API 2019-04-07 16:38:18 +01:00
Aidan Woods
f83ee87902 Make this pattern a bit more reusable 2019-04-07 16:38:18 +01:00
Aidan Woods
a396fccace No contexts implies everything being appended is a blank line
(of which where is at least one).
2019-04-07 16:38:18 +01:00
Aidan Woods
4fb6ac31a5 Improve tests 2019-04-07 16:38:18 +01:00
Aidan Woods
c0792947a6 Remove unused methods 2019-04-07 16:38:17 +01:00
Aidan Woods
65450f47cd Simplify 2019-04-07 16:38:17 +01:00