Browse Source

fix: don’t save a list but a string as attribute value

tags/microformats2-0.0.2
Christian Kruse 5 years ago
parent
commit
6094fc9e43
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      lib/items.ex

+ 3
- 3
lib/items.ex View File

@@ -122,11 +122,11 @@ defmodule Microformats2.Items do

cond do
Enum.member?(["time", "ins", "del"], elem) and not Microformats2.blank?(dt) ->
dt
dt |> List.first
elem == "abbr" and not Microformats2.blank?(title) ->
title
title |> List.first
Enum.member?(["data", "input"], elem) and not Microformats2.blank?(value) ->
value
value |> List.first
true ->
text_content(child) |> String.strip
end


Loading…
Cancel
Save