Diff
diff --git a/cstyle/transformers/ul/main.go b/cstyle/transformers/ul/main.go
index 534ff49..ecf38ba 100644
--- a/cstyle/transformers/ul/main.go
+++ b/cstyle/transformers/ul/main.go
@@ -5,0 +6 @@ import (
+ "strconv"
@@ -11 +12 @@ func Init() cstyle.Transformer {
- return n.TagName == "ul"
+ return n.TagName == "li"
@@ -14,5 +15,2 @@ func Init() cstyle.Transformer {
- tN := n.CreateElement(n.TagName)
- for _, v := range n.Children {
- li := n.CreateElement("li")
- li.Style = v.Style
- dot := li.CreateElement("div")
+ if n.Parent.TagName == "ul" {
+ dot := n.CreateElement("div")
@@ -25,8 +23,4 @@ func Init() cstyle.Transformer {
- content := li.CreateElement("div")
- content.InnerText = v.InnerText
- content.Style = v.Style
- content.Style = c.QuickStyles(&content)
- content.Style["display"] = "block"
- li.AppendChild(dot)
- li.AppendChild(content)
- li.Parent = &n
+ content := n.CreateElement("div")
+ content.InnerText = n.InnerText
+ content.Style = n.Style
+ content.Style = c.GetStyles(&content)
@@ -34,3 +28,36 @@ func Init() cstyle.Transformer {
- li.Style["display"] = "flex"
- li.Style["align-items"] = "center"
- li.Style = c.QuickStyles(&li)
+ n.AppendChild(dot)
+ n.AppendChild(content)
+
+ } else if n.Parent.TagName == "ol" {
+ dot := n.CreateElement("div")
+ // dot.Style["background"] = "#000"
+ // dot.Style["border-radius"] = "100px"
+ // dot.Style["width"] = "7px"
+ // dot.Style["height"] = "7px"
+ dot.Style = n.Style
+ dot.Style = c.GetStyles(&dot)
+ // dot.Style["color"] = "#000"
+
+ for i, v := range n.Parent.Children {
+ if v.Properties.Id == n.Properties.Id {
+ // var w int
+ // for _, v := range c.Fonts {
+ // w = font.MeasureText(&element.Text{Font: &v}, strconv.Itoa(i+1)+".")
+ // break
+ // }
+ dot.InnerText = strconv.Itoa(i+1) + "."
+ // fmt.Println(w)
+ // dot.Style["margin-right"] = strconv.Itoa(30-w) + "px"
+ break
+ }
+ }
+
+ // !ISSUE: needs to run on parent element so it can know the entire widths of everything, also prob could run styles once?
+
+ content := n.CreateElement("div")
+ content.InnerText = n.InnerText
+ content.Style = n.Style
+ content.Style = c.GetStyles(&content)
+
+ n.AppendChild(dot)
+ n.AppendChild(content)
@@ -38 +64,0 @@ func Init() cstyle.Transformer {
- tN.AppendChild(li)
@@ -40 +65,0 @@ func Init() cstyle.Transformer {
- n.Children = tN.Children