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

70 Commits

Author SHA1 Message Date
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
f83ee87902
Make this pattern a bit more reusable 2019-04-07 16:38:18 +01:00
Aidan Woods
015e476f3e
Remove unused import 2019-04-07 16:38:17 +01:00
Aidan Woods
289b641a42
Remove inaccurate comment 2019-04-07 16:38:17 +01:00
Aidan Woods
147a87a4f3
These are self-explainitory 2019-04-07 16:38:16 +01:00
Aidan Woods
b90efc69ec
Ensure marker is properly contained in the Inline 2019-04-07 16:38:16 +01:00
Aidan Woods
30613b2430
Ensure $startPosition is positive 2019-04-07 16:38:16 +01:00
Aidan Woods
369aea5d8d
Collect State from continuable state updating block on advance 2019-04-07 16:38:15 +01:00
Aidan Woods
2b79d599fb
Require State to build and advance blocks 2019-04-07 16:38:15 +01:00
Aidan Woods
a681cf631c
Acquisition capable blocks as an interface 2019-04-07 16:38:15 +01:00
Aidan Woods
117912c373
Substr over indexing string 2019-04-07 16:38:12 +01:00
Aidan Woods
cb211a88a8
PHP < 7 compat 2019-04-07 16:38:12 +01:00
Aidan Woods
c49d40027f
Add StateBearer which can carry state 2019-04-07 16:38:11 +01:00
Aidan Woods
48c0c34470
Caching for initial configurable values removes need to seed state 2019-04-07 16:38:07 +01:00
Aidan Woods
bc3c1544c5
Don't special case invisible
If something has no html, it doesn't need to have a newline
2019-04-07 16:38:06 +01:00
Aidan Woods
d6f526d80f
Return state after block parse instead of mutating the instance copy 2019-04-07 16:38:06 +01:00
Aidan Woods
d733c262c2
Cleanup logical operators 2019-04-07 16:38:06 +01:00
Aidan Woods
11da347aa1
We don't need to pass a Parsedown instance down
Since Parsedown is instancible from State, we only
need to carry that down.
2019-04-07 16:38:05 +01:00
Aidan Woods
9f9ef78662
This should be slightly faster
Merge would honour changes, and removals
are equivalent to changing to default value.
2019-04-07 16:38:05 +01:00
Aidan Woods
57632f38fb
More meaningful method name 2019-04-07 16:38:05 +01:00
Aidan Woods
5e7fb61879
More keyword fixes for pre-PHP7 2019-04-07 16:38:05 +01:00
Aidan Woods
2618509cc6
Now the class is a bit shorter we can remove these makeshift dividers 2019-04-07 16:38:04 +01:00
Aidan Woods
fce4633ff9
Inlines and Blocks as Configurables 2019-04-07 16:38:04 +01:00
Aidan Woods
5a50930cb0
Allow inlines to backtrack into characters that were suspected as
inlines but ruled out
This is required for backslash escaped Hard breaks to work:
Parsedown first checks to see if these are escape sequences,
however when they are ruled out they should not be assumed to be
plaintext since a later inline (Hardbreak) may backtrack into these
unconsumed characters.
2019-04-07 16:38:04 +01:00
Aidan Woods
1fd2e14b72
Add hard and soft breaks 2019-04-07 16:38:04 +01:00
Aidan Woods
714ae50211
Text variable isn't very useful inside the loop 2019-04-07 16:38:04 +01:00
Aidan Woods
14b3761687
Produce Blocks before converting to StateRenderables
(As we do with Inlines)
2019-04-07 16:38:04 +01:00
Aidan Woods
576a2c4519
Generalise line parsing to return Inlines before applying state 2019-04-07 16:38:01 +01:00
Aidan Woods
083ad582c7
State management
Decouple state from final rendering
Restore initial state after parsing
2019-04-07 16:38:01 +01:00
Aidan Woods
c9388cb5c2
Make use of line name instead of lineElements 2019-04-07 16:38:01 +01:00
Aidan Woods
bb8a16ad81
Remove useless line method
This will be achievable by directly restricting enabled Components
2019-04-07 16:38:01 +01:00
Aidan Woods
7f526c07a0
Indent offset is encompassed in Lines object 2019-04-07 16:38:01 +01:00
Aidan Woods
dac6b01d1a
Remove meaningless interrupt check
Interrupted implies previousEmptyLines > 0 in incoming Context
2019-04-07 16:38:00 +01:00
Aidan Woods
e4ed4da626
More keyword related fixes for pre PHP 7 2019-04-07 16:38:00 +01:00
Aidan Woods
e6e24a8d0d
Rewrite to use new internals 2019-04-07 16:37:58 +01:00
Aidan Woods
36cfb21908
Remove no longer needed parts of core class 2019-04-07 16:37:58 +01:00
Aidan Woods
dbdbda52a8
Make Parsedown non-extendable and remove comment header 2019-04-07 16:37:58 +01:00
Aidan Woods
114eb0bc5b
Add required imports 2019-04-07 16:37:57 +01:00
Aidan Woods
a286033f52
Implement UrlTag 2019-04-07 16:37:57 +01:00
Aidan Woods
53bb9a6467
Implement Url 2019-04-07 16:37:57 +01:00
Aidan Woods
db1d0a4999
Implement Strikethrough 2019-04-07 16:37:57 +01:00
Aidan Woods
f256352f53
Implement SpecialCharacter 2019-04-07 16:37:57 +01:00
Aidan Woods
778eacd081
Implement Markup 2019-04-07 16:37:57 +01:00
Aidan Woods
5e8905c455
Implement Image 2019-04-07 16:37:57 +01:00
Aidan Woods
dad0088adb
Implement Link 2019-04-07 16:37:56 +01:00
Aidan Woods
79a38a1ebb
Implement EscapeSequence 2019-04-07 16:37:56 +01:00
Aidan Woods
164a39f3e9
Implement Emphasis 2019-04-07 16:37:56 +01:00
Aidan Woods
f2a3a2fb08
Implement Email 2019-04-07 16:37:56 +01:00
Aidan Woods
497045d25b
Implement Code 2019-04-07 16:37:56 +01:00