Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced <kbd> element with <span> for the keyboard sequence. #76

Merged
merged 1 commit into from Aug 25, 2016
Merged

Replaced <kbd> element with <span> for the keyboard sequence. #76

merged 1 commit into from Aug 25, 2016

Conversation

ghost
Copy link

@ghost ghost commented Jul 21, 2016

Regarding Asciidoctor's Ruby code, the keyboard sequence element should not be <kbd> but <span>

Here is the ruby code from html5.rb :

def inline_kbd node
  if (keys = node.attr 'keys').size == 1
    %(<kbd>#{keys[0]}</kbd>)
  else
    key_combo = keys.map {|key| %(<kbd>#{key}</kbd>+) }.join.chop
    %(<span class="keyseq">#{key_combo}</span>)
  end
end

Regarding ASCIIDOCTOR ruby code the keyboard sequence should not be <kbd> but <span>

here is the ruby code  :
https://github.com/asciidoctor/asciidoctor/blob/ef7d3a113fd9b17470987cde845313a01129529f/lib/asciidoctor/converter/html5.rb

    def inline_kbd node
      if (keys = node.attr 'keys').size == 1
        %(<kbd>#{keys[0]}</kbd>)
      else
        key_combo = keys.map {|key| %(<kbd>#{key}</kbd>+) }.join.chop
        %(<span class="keyseq">#{key_combo}</span>)
      end
    end
@mojavelinux
Copy link
Member

👍 to aligning with the built-in HTML converter.

The reason we made this change was so that it was compatible with the styling of the <kbd> element in themes. If we nest the <kbd> elements, then the ornamentation gets compounded.

@obilodeau obilodeau merged commit 338bf03 into asciidoctor:master Aug 25, 2016
@ghost ghost deleted the patch-1 branch August 29, 2016 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants