mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Use file's URL as document's URL when loading markdown files
A markdown file gets loaded as an inline content document by `create_document_for_inline_content()`, for which the default document URL is "about:error". That breaks the fragment links. Overriding "about:error" URL by passing the URL of the just loaded markdown file as an argument to `HTMLParser::run()` ensures that the URL of the document is as expected.
This commit is contained in:
parent
6c31f2a68a
commit
05e53b5fd3
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/ronak69
Commit: 05e53b5fd3
Pull-request: https://github.com/SerenityOS/serenity/pull/23017
Reviewed-by: https://github.com/trflynn89
1 changed files with 1 additions and 1 deletions
|
@ -78,7 +78,7 @@ static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOM::Document>> load_markdown_docume
|
|||
return;
|
||||
|
||||
auto parser = HTML::HTMLParser::create(document, markdown_document->render_to_html(extra_head_contents), "utf-8");
|
||||
parser->run(document.url());
|
||||
parser->run(url);
|
||||
};
|
||||
|
||||
auto process_body_error = [](auto) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue