Replace uuids with "nanoid"s
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
import Ecto.UUID, only: [generate: 0]
|
||||
import Nanoid, only: [generate: 0]
|
||||
|
||||
alias Outlook.InternalTree.InternalNode
|
||||
|
||||
@ -22,7 +22,7 @@ defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
name: tag,
|
||||
attributes: clean_atts_to_map(attributes),
|
||||
type: :element,
|
||||
uuid: generate(),
|
||||
nid: generate(),
|
||||
content: floki_to_internal(content)
|
||||
} | floki_to_internal(rest) ]
|
||||
end
|
||||
@ -30,7 +30,7 @@ defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
def floki_to_internal [ "" <> textnode | rest ] do
|
||||
[ %InternalNode{
|
||||
type: :text,
|
||||
uuid: generate(),
|
||||
nid: generate(),
|
||||
content: textnode
|
||||
} | floki_to_internal(rest) ]
|
||||
end
|
||||
@ -38,7 +38,7 @@ defmodule Outlook.HtmlPreparations.HtmlPreparation do
|
||||
def floki_to_internal [ {:comment, comment} | rest ] do
|
||||
[ %InternalNode{
|
||||
type: :comment,
|
||||
uuid: generate(),
|
||||
nid: generate(),
|
||||
content: comment
|
||||
} | floki_to_internal(rest) ]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user