File tree Expand file tree Collapse file tree 3 files changed +24
-49
lines changed
converter/src/main/kotlin/de/jensklingenberg/htmltocfw/converter Expand file tree Collapse file tree 3 files changed +24
-49
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package de.jensklingenberg.htmltocfw.converter
2
2
3
3
import de.jensklingenberg.htmltocfw.converter.node.getMyNode
4
4
import org.jsoup.Jsoup
5
+ import org.jsoup.parser.Parser
5
6
import java.io.File
6
7
7
8
fun main () {
@@ -17,7 +18,7 @@ fun main() {
17
18
}
18
19
19
20
fun htmlToCompose (html : String ): String {
20
- val doc = Jsoup .parse(html);
21
+ val doc = Jsoup .parse(html, Parser .xmlParser() );
21
22
22
23
return doc.body().childNodes().joinToString(separator = " " ) {
23
24
getMyNode(it).print ()
Original file line number Diff line number Diff line change 1
- H1 {
2
- Text("The input element")
3
-
4
- }
5
- Form (action = "/action_page.php"){
6
- Label (forId = "fname"){
7
- Text("First name:")
8
-
9
- }
10
- Input (attrs = {
11
- id("fname")
12
- name("fname")
13
- }, type = InputType.Text)
14
- Br {}
15
- Br {}
16
- Label (forId = "lname"){
17
- Text("Last name:")
18
-
19
- }
20
- Input (attrs = {
21
- id("lname")
22
- name("lname")
23
- }, type = InputType.Text)
24
- Br {}
25
- Br {}
26
- Input (attrs = {
27
- attr("value","Submit")
28
- }, type = InputType.Submit)
29
-
1
+ Button (attrs = {
2
+ name("button")
3
+ attr("type","button")
4
+ style {
5
+ margin(16.px)
6
+ padding(16.px)
7
+ property("background-color","darkblue")
8
+ property("color","aliceblue")
9
+ borderRadius(4.px)
10
+ fontSize(12.px)
30
11
}
31
- P {
32
- Text("Click the \"Submit\" button and the form-data will be sent to a page on the server called \"action_page.php\".")
12
+ attr("onClick","alert('Hello World!')")
13
+ }){
14
+ Text("Click Me!")
33
15
34
16
}
Original file line number Diff line number Diff line change 1
- <!DOCTYPE html>
2
- <html>
3
- <body>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Document</title>
5
+ </head>
6
+ <body>
4
7
5
- <h1>The input element</h1 >
8
+ <button name="button" type="button" style="margin: 16px; padding: 16px; background-color: darkblue; color: aliceblue;border-radius: 4px;font-size: 12px" onClick="alert('Hello World!')">Click Me!</button >
6
9
7
- <form action="/action_page.php">
8
- <label for="fname">First name:</label>
9
- <input type="text" id="fname" name="fname"><br><br>
10
- <label for="lname">Last name:</label>
11
- <input type="text" id="lname" name="lname"><br><br>
12
- <input type="submit" value="Submit">
13
- </form>
14
-
15
- <p>Click the "Submit" button and the form-data will be sent to a page on the
16
- server called "action_page.php".</p>
17
-
18
- </body>
19
- </html>
10
+ </body>
11
+ </html>
You can’t perform that action at this time.
0 commit comments