Sha256: 766f5d48d3a2f88c63132b675767917293ddadd7f58300bf6c93f4096f6cf11d
Contents?: true
Size: 867 Bytes
Versions: 3
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true module MicroMicro module Parsers class PlainTextPropertyParser < BasePropertyParser HTML_ATTRIBUTES_MAP = { 'title' => %w[abbr link], 'value' => %w[data input], 'alt' => %w[area img] }.freeze # @see https://microformats.org/wiki/microformats2-parsing#parsing_a_p-_property # microformats.org: microformats2 parsing specification ยง Parsing a +p-+ property # # @return [String] def value @value ||= value_class_pattern_value || attribute_value || super end private # @return [String, nil] def attribute_value Helpers.attribute_value_from(node, HTML_ATTRIBUTES_MAP) end # @return [String, nil] def value_class_pattern_value ValueClassPatternParser.new(node).value end end end end
Version data entries
3 entries across 3 versions & 1 rubygems