- sect0 = section_level == 0
= html_tag_if !sect0, :section, :class=>["sect#{section_level}", role]
  *{:tag=>"h#{section_level + 1}", :id=>id, :class=>('sect0' if sect0)}
    - if id && (document.attr? :sectanchors)
      a.anchor href="##{id}"
      =section_title
    - elsif id && (document.attr? :sectlinks)
      a.link href="##{id}" =section_title
    - else
      =section_title
  =content

- sect0 = section_level == 0
= html_tag_if !sect0, :section, :class=>["sect#{section_level}", role]
  *{:tag=>"h#{section_level + 1}", :id=>id, :class=>('sect0' if sect0)}
    - if id
      - if document.attr? :sectanchors
        a.anchor href="##{id}"
      - if document.attr? :sectlinks
        a.link href="##{id}" =section_title
      - else
        =section_title
    - else
      =section_title
  =content

Allow sectanchors & sectlinks to be used in tandem
Allow sectanchors & sectlinks to be used in tandem

Ported from https://github.com/asciidoctor/asciidoctor/commit/e51f309a35cb56c2f5bc68e0686dfdfc2e646395

jirutka/asciidoctor-html5,jirutka/asciidoctor-html5