Commit ed82b431 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

StyleSheetFixer: improve documentation and add a TODO

parent b619c466
Pipeline #200062 passed with stage
in 14 minutes and 18 seconds
......@@ -24,6 +24,15 @@
#include <QUrl>
namespace {
* This class makes sure that CSS embedded in man pages works and applies a custom style sheet on top.
* TODO: once Qt WebKit support is dropped, register with Qt WebEngine the "man" and "help" URL schemes as
* local; handle them. This will also make file:// links work properly. So this class would no longer
* have to fix embedded links and only need to embed our custom manpagedocumentation.css style like
* this: "<link href='file://%1' rel='stylesheet'>". Registering and handling the schemes might even
* allow to simplify the whole kdevmanpage plugin implementation.
class StyleSheetFixer
......@@ -51,6 +60,9 @@ private:
* @note Referencing a local file via absolute path or file:// URL inside a &lt;link&gt;
* HTML element does not work because Qt WebEngine forbids such file system access.
* A comment under QTBUG-55902 proposes a workaround: pass "file://" as the baseUrl
* argument to QWebEnginePage::setHtml(). Unfortunately this base URL does not persist
* during back/forward web history navigation, so such navigation loads unstyled pages.
static QString readStyleSheet(const QString& fileName)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment