Advertising sustains the DA. Ads are hidden for members. Join today

Setup

Last updated on
4 July 2022
  1. Download the latest release of the module recommended for your Drupal version from the website for htmLawed module. Uncompress the download and move the htmlawed folder to the right location in your Drupal installation directory; e.g., sites/all/modules (you may have to create such a sub-folder), or you can use an option such as in Drupal 7: Administration » Modules » Install new module.
  2. Install the module as appropriate. E.g., in Drupal 9: Administration » Extend, and in Drupal 7: Administration » Modules.
  3. Installation without manual download, using Composer (Drupal 8-10; e.g., composer require 'drupal/htmlawed:^4.1'), or from within Drupal (Drupal 10) is possible.
  4. To use the htmLawed filter, it first has to be enabled for, for example, for an input/text format. E.g., in Drupal 10: Administration » Configuration » Content authoring » Text formats and editors, and in Drupal 7: Administer » Configuration » Content authoring » Text formats section, and configure one or more input text format to use htmLawed by selecting it in the list of filters available for the formats. With htmLawed turned on, you may safely disable Drupal's core filters to limit allowed HTML or correct faulty HTML. Depending on the other filters enabled for the format, you may need to rearrange the processing order of the filters for the htmLawed filtering to work properly. Usually, htmLawed would be set to run as the last filter. Regardless, htmLawed has to be configured such as to allow any HTML markup generated by filters that are executed before it.
  5. To configure the htmLawed filter for a text format, with different configurations used by different text formats, look for the htmLawed settings form within the settings form for the format. By default, htmLawed runs with the safe option enabled, and permits the use of the tags a, em, strong, cite, code, ol, ul, li, dl, dt and dd (and br and p in case of Drupal 8) but denies the id and style tag (HTML element) attributes as well as the unsafe and scriptable attributes like onclick. For more on the form-fields like Config. that are used for setting htmLawed's filtering rules, see other guide pages.

Help improve this page

Page status: No known problems

You can: