squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Search input autocorrect attribute

mbunyan opened this issue · comments

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

I was unable to find attribute 'autocorrect' in W3 standards, I think it may be a non-standard attribute supported by Safari.

HTML validation of output throws a couple of errors, but does not fail outright.

Should the output be using spellcheck='false' (as well) to cover requirements?

After running mkdocs build:
form name='search' is created which include input with attribute 'autocorrect'

I think using type='search' would be more appropriate with 'autocomplete' attribute in place.

Expected behaviour

No html validation errors

Actual behaviour

Typical html validator like https://validator.w3.org/ throws:

Attribute autocomplete is only allowed when the input type is color, date, datetime-local, email, hidden, month, number, password, range, search, tel, text, time, url, or week.

Attribute autocorrect not allowed on element input at this point.

Steps to reproduce

  1. build site
  2. upload sample page to https://validator.w3.org/ or use html validator 'tidy'

Package versions

  • Python: python --version 3.10.4
  • MkDocs: mkdocs --version 1.3.0
  • Material: pip show mkdocs-material | grep -E ^Version 8.3.4

Configuration

site_name: Notebook
plugins:
  - search
  - tags:
      tags_file: tags.md
theme:
  name: material
  favicon: images/favicon.ico
  font: false
  palette:
    primary: amber
    accent: indigo
  features:
    - navigation.tabs
markdown_extensions:
  - def_list
  - footnotes
  - md_in_html
  - tables

System information

  • Operating system: ubuntu linux 22.04
  • Browser: Firefox 101

Yes, it is non-standard, but it was necessary at some point. I'm not sure whether it is safe to remove though, old clients may still use this attribute to turn off spellcheck. Research would be necessary. Keeping it is cheaper. If you feel it should be removed, you can extend the theme, but we rather also support old clients.