Replace uuids with "nanoid"s

This commit is contained in:
Thelonius Kort
2023-01-11 19:01:28 +01:00
parent 881a8ee094
commit 403116cd08
16 changed files with 38 additions and 33 deletions

View File

@ -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