-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix image upload and resolver and use CommonMark #69
base: dev
Are you sure you want to change the base?
Conversation
$pureTitle = strip_tags($render); | ||
|
||
if ($block instanceof Heading) { | ||
$this->headers[] = ["text" => $pureTitle, "level" => $level = $block->getLevel(), "id" => $id = "h$level-" . $this->slugify($pureTitle) . "-" . substr(md5($render), 0, 10)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, indenting theses long multi parameters string in vertical to be more readable.
["text" => $pureTitle,
"level" => $level = $block->getLevel(),
...,
]
|
||
|
||
|
||
public function extractTOC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking this function into multiple chunks will help maintaining and understanding the code later
if (count($lastOfLevel) < 1) { | ||
$tree[] = &$c; | ||
} | ||
$lastOfLevel[$c["level"]] = &$c; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid abbreviating variable please :/
|
||
} | ||
|
||
private function slugify($string, $delimiter = '-') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick comment to summarize what will be cleaned after this function. Or a link to a standard "slugify" process explanation
return ["!"]; | ||
} | ||
|
||
public function parse(InlineParserContext $inlineContext): bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break this function into small reusable chunks will help maintaining the code.
Also a quick comment to explain whats happening here
throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline)); | ||
} | ||
dump($inline); | ||
$style = implode("", array_map(fn($k, $v) => "$k: {$v}px;", array_keys($inline->getData("size", [])), array_values($inline->getData("size", [])))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiline syntax for parameters help readability here.
|
||
use Symfony\Component\Finder\SplFileInfo; | ||
|
||
class File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Purpose of this POPO as comment can help
public SerializerInterface $serializer; | ||
|
||
|
||
public function parse(MarkdownFile &$file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why parsing Markdown is done with PHP and not by the front-end ?
…by default" This reverts commit 48776e9.
* adding trusted_proxies for dev and public opened to everyone by default * Revert "adding trusted_proxies for dev and public opened to everyone by default" This reverts commit 48776e9. * adding permission + fix upload/edit file * adding readonly info * update for passing through twig constants * fix: move settings to plugins * quick fix typo in delete * fix: removing route for settings
* adding trusted_proxies for dev and public opened to everyone by default * Revert "adding trusted_proxies for dev and public opened to everyone by default" This reverts commit 48776e9. * fix: setting default to fileName * fix: quick fix for a not existing file
* adding trusted_proxies for dev and public opened to everyone by default * Revert "adding trusted_proxies for dev and public opened to everyone by default" This reverts commit 48776e9. * adding meta title to page - needs more styling I think * fix: style test * move article title and make it optionnal * removing computed for current metadata * fix: removing extra useless component
* Revert "adding trusted_proxies for dev and public opened to everyone by default" This reverts commit 48776e9. * adding meta title to page - needs more styling I think * fix: style test * move article title and make it optionnal * removing computed for current metadata * fix: removing extra useless component * adding custom header metadata handler * rebasing * removing unwanted changes * fix: removing useless changes
Closes #65