Notes: Add .underline for underlined text

Kinda resolves #499 but in a different way
This commit is contained in:
Ilya Prokopenko 2022-03-23 16:43:17 +03:00
parent e3312cb5f2
commit 46db744caf
No known key found for this signature in database
GPG key ID: 7736BBBB05F14A56
3 changed files with 14 additions and 0 deletions

View file

@ -48,6 +48,7 @@ class Note extends Postable
"acronym", "acronym",
"blockquote", "blockquote",
"cite", "cite",
"span",
]); ]);
$config->set("HTML.AllowedAttributes", [ $config->set("HTML.AllowedAttributes", [
"table.summary", "table.summary",
@ -59,6 +60,8 @@ class Note extends Postable
"img.style", "img.style",
"div.style", "div.style",
"div.title", "div.title",
"span.class",
"p.class",
]); ]);
$config->set("CSS.AllowedProperties", [ $config->set("CSS.AllowedProperties", [
"float", "float",
@ -68,6 +71,9 @@ class Note extends Postable
"max-width", "max-width",
"font-weight", "font-weight",
]); ]);
$config->set("Attr.AllowedClasses", [
"underline",
]);
$purifier = new HTMLPurifier($config); $purifier = new HTMLPurifier($config);
return $purifier->purify($this->getRecord()->source); return $purifier->purify($this->getRecord()->source);

View file

@ -54,6 +54,10 @@
#userContent cite::before { #userContent cite::before {
content: "— "; content: "— ";
} }
#userContent .underline {
text-decoration: underline;
}
</style> </style>
<div class="container_gray" style="background: white; border-top: none;"> <div class="container_gray" style="background: white; border-top: none;">

View file

@ -33,6 +33,10 @@
#userContent cite::before { #userContent cite::before {
content: "— "; content: "— ";
} }
#userContent .underline {
text-decoration: underline;
}
</style> </style>
<article id="userContent" style="margin: 10px 10px 0;"> <article id="userContent" style="margin: 10px 10px 0;">