ParagraphLengthAuditor
The info.magnolia.services.seo.audit.impl.ParagraphLengthAuditor checks the length in words of HTML elements containing text, not the overall length in characters. You can use this auditor to check for pages with overly long text blocks. This can any HTML element that containing text which can be located by a jsoup query.
- Class
-
info.magnolia.services.seo.audit.impl.ParagraphLengthAuditor
Properties
In addition to the common auditor properties, this auditor can be configured with the following properties:
Property | Description | ||
---|---|---|---|
|
required Determines how a failed audit will be counted:
|
||
|
required Defines the property name for storing failed audit results.
|
||
|
required Defines a message or explanation for a failed audit. The message can have placeholders that are replaced with information about the node and auditor:
|
||
|
required Defines the content fetcher for the selected node. The query is then applied to the fetched content. There are two types of content fetchers available. |
||
|
required A valid jsoup query. See this cookbook for more on jsoup queries. |
||
|
optional Defines the maximum number of words allowed in the text block. If not specified, then the limit will be |
Example
Here is an example from the SEO module. You can find this configuration here: /modules/seo/config/auditManager/auditors/excessivePageText
.
excessivePageText:
auditProperty: excessiveText
auditValue: The page {0} contains {1} paragraphs that are too long
class: info.magnolia.services.seo.audit.impl.ParagraphLengthAuditor
description: Check if any paragraph is too long (pre-prod)
level: auditWarnings
fetcher:
class: info.magnolia.services.seo.audit.impl.RequestFetcher
targets:
localhost:
class: info.magnolia.services.seo.audit.impl.HostTarget
host: localhost
password: superuser
port: 8080
scheme: http
user: superuser