Clean up HTML output for Drupal 8

Final / Up to date -- AWAITING PEER REVIEW
This lesson will help you learn to improve Drupal's HTML output.
  • a clean checkout of the Drupal code base in which the issue appears (instructions)
  • the ability to apply and test patches (instructions)
  • at least a beginner-level familiarity with PHP and the Drupal API
  • your favorite note-taking application
  1. Make sure you're running the latest version of Drupal 8
    cd path/to/drupal
    cd checkout 8.x
    git pull origin 8.x
  2. Create your own local working branch:
    git checkout -b example-twig-issue
  3. Go to the Creating Dream Markup queue for a list of HTML cleanup issues
  4. Choose an issue.
  5. Clean up the HTML in the specified template.
    • start with the code from the issue: cut/paste into template
    • test the code from the issue - does it actually work?
    • If not, fix it.
  6. Create a patch.
  7. Test your patch on branch 8.x to make sure it works
    git checkout 8.x
    git apply path/to/my-new.patch
  8. Then reset to clean up branch 8.x
    git reset --hard
  9. Post your patch to the issue, and change the status to needs review

Lesson tags: