MarkupQA class

HTML Markup Quality Assurance

Provides runtime quality assurance for markup stored in [textarea] field values.

  1. Ensures URLs referenced in and tags are relative to actual site root.
  2. Ensures local page URLs referenced in tags up-to-date with current $page URL.
  3. Identifies and logs tags that point to non-existing files in PW's file system.
  4. Re-creates image variations that don't exist, when the original still exists.
  5. Populates blank 'alt' attributes with actual file description.

Runtime errors are logged to: /site/assets/logs/markup-qa-errors.txt


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the MarkupQA class also inherits all the methods and properties of: Wire.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
MarkupQA::checkImgTags(string $value)
None

Quality assurance for <img> tags

 
MarkupQA::debug()
bool

Get or set debug status

 
MarkupQA::error(string $text)
$this

Record error message to image-errors log

 
MarkupQA::findLinks()
PageArray array int

Find pages linking to another

 
MarkupQA::ignorePaths()
array

Get or set paths to ignore for link abstraction

 
MarkupQA::setField(Field $field)
None

Set the current Field

 
MarkupQA::setPage(Page $page)
None

Set the current Page

 
MarkupQA::sleepLinks(string $value)
None

Sleep href attributes, adding a data-pwid attribute to <a> tags that resolve to a Page

 
MarkupQA::sleepUrls($value)
None

Sleep URLs in href or src attributes for storage

 
MarkupQA::verbose()
bool

Get or set verbose state

 
MarkupQA::wakeupLinks($value)
array

Wakeup href attributes, using the data-pwid attribute to update the href attribute as necessary

 
MarkupQA::wakeupUrls($value)
None

Wakeup URLs in href or src attributes for presentation

 

Additional methods and properties

In addition to the methods and properties above, MarkupQA also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252