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)
NoneQuality assurance for <img> tags 
MarkupQA::debug()
boolGet or set debug status 
MarkupQA::error(string $text)
$thisRecord error message to image-errors log 
MarkupQA::findLinks()
PageArray array intFind pages linking to another 
MarkupQA::ignorePaths()
arrayGet or set paths to ignore for link abstraction 
MarkupQA::setField(Field $field)
NoneSet the current Field 
MarkupQA::setPage(Page $page)
NoneSet the current Page 
MarkupQA::sleepLinks(string $value)
NoneSleep href attributes, adding a data-pwid attribute to <a> tags that resolve to a Page 
MarkupQA::sleepUrls($value)
NoneSleep URLs in href or src attributes for storage 
MarkupQA::verbose()
boolGet or set verbose state 
MarkupQA::wakeupLinks($value)
arrayWakeup href attributes, using the data-pwid attribute to update the href attribute as necessary 
MarkupQA::wakeupUrls($value)
NoneWakeup 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.251