Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing tag figcaption #13

Closed
holgerbrandl opened this issue Feb 20, 2016 · 6 comments
Closed

missing tag figcaption #13

holgerbrandl opened this issue Feb 20, 2016 · 6 comments
Assignees
Labels

Comments

@holgerbrandl
Copy link

The figcaption tag is missing in the kotlinx DSL.

See http://w3c.github.io/html-reference/figcaption.html

In fact it would be even more helpful if the docs could detail out how to add a custom tag on top of the existing library (if this is possible with kotlinx) (ie to show how to extend the kotlinx DSL). In https://github.com/kotlin/kotlinx.html/wiki/Micro-templating-and-DSL-customizing you already do so to some extent, but custom tags don't seem not to be covered there.

For now the only workaround seems to be

StringBuilder().apply {
    appendHTML().figure() {
        img {
            src = movie.movieInfo?.coverImageURL
        }
    }
    append("<figcaption class='picture-item__title pull-left'>" + movie.name + """</figcaption>""")
}

but by using kotlinx I'd like to avoid simple unstructured string-building.

@cy6erGn0m cy6erGn0m self-assigned this Feb 20, 2016
@cy6erGn0m cy6erGn0m added the bug label Feb 20, 2016
@cy6erGn0m
Copy link
Contributor

@holgerbrandl sure, you shouldn't. Btw you shouldn't append tags by append as the content should be properly escaped. You need to use unsafe for that purpose.

Let me look at the tag definition

@cy6erGn0m
Copy link
Contributor

@cy6erGn0m
Copy link
Contributor

What developer should do to fix missing tags/attributes
https://github.com/Kotlin/kotlinx.html/wiki/Development#if-something-is-missing

@cy6erGn0m
Copy link
Contributor

Fixed in 0.5.7

@holgerbrandl
Copy link
Author

Thanks for the fast doc-update. Worked great for me to add figcaption. Imbho capitalization is wrong in the extension function of the example : Instead of fun DIV.CUSTOM(...) it should be fun DIV.custom(...)

@cy6erGn0m
Copy link
Contributor

@holgerbrandl ops, just an accident

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants