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

level

required

Determines how a failed audit will be counted:

  • Error (auditErrors)

  • Warning (auditWarnings)

  • Note (auditNotes)

auditProperty

required

Defines the property name for storing failed audit results.

The property name should be unique among auditors or auditors may overwrite results.

auditValue

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:

  • 0 - node path

  • 1 - configured query property

fetcher

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.

query

required

A valid jsoup query. See this cookbook for more on jsoup queries.

maxWords

optional

Defines the maximum number of words allowed in the text block. If not specified, then the limit will be 150.

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
Feedback

Incubators

×

Location

This widget lets you know where you are on the docs site.

You are currently perusing through the SEO module docs.

Main doc sections

DX Core Headless PaaS Legacy Cloud Incubator modules