Git Product home page Git Product logo

korte's People

Contributors

soywiz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

korte's Issues

Accessing a property in a list of object not working on IOS

Example case:

@Serializable data class Output(val value: String, val index: Int) : DynamicType<Output> by DynamicType({
register(Output::value)
register(Output::index)
})

val values = listOf(Output("Yes", 0))

val template = Template("{{values[0].value}}", TemplateConfig())
return template(this) //works on android. On IOS i am receiving a segmentation crash

Configurable escaping for non-HTML templates

I'm using Korte for a non-HTML template. The template engine is escaping values with htmlspecialchars. I can work around it with RawString, but it'd be nice if I could turn off the escaping globally, or provide an alternative or custom escaping mechanism.

Decoding from string to serialized data class and accessing its properties on IOS causing segmentation fault

fun testUser(): User? {
    val x = """{
                "key": "test user",
                "firstName": "test",
                "lastName": "test"
            }"""

    return Json.decodeFromString(User.serializer(), x)
}

@serializable
data class User(val key: String, val firstName: String, val lastName: String) :
DynamicType by DynamicType({
register(User::key)
register(User::firstName)
register(User::lastName)
})

i am exposing this function to use it in a expression where the user also has its properties exposed

evaluating testUser().key is working when testing on android but on IOS i am receiving a segmentation fault

Fails to access fields on Android

I was trying to access the latitude and longitude fields of a LatLng instance on Android. While putting the entire object in my template rendered correctly (implicitly using the object's toString() method) trying to access one of its fields didn't work.

Looking at the code here it appears that the JvmObjectMapper2 only attempts to invoke the getter when accessing a property; never trying to access the field directly in the absence of a getter. This line would indicate that the mapper considers a field a potential property, and the MyProperty subclass contains everything needed to access a field, but the mapper itself never tries to access it (nor does any other class).

Yaml issue

@Test
fun testChunk2() {
    assertEquals(
        mapOf(
            "layout" to "post",
            "title" to "demo: 2D test demo lorem ipsum",
            "title_es" to "lorem: ipsum sim de 2D te test",
            "date" to "2009-05-05T10:45:00.000+02:00",
            "author" to "abc def hij",
            "tags" to listOf("lorem", "ipsum"),
            "feature_image" to "/images/2009/ipsum.png",
            "modified_time" to "2011-05-14T15:39:49.185+02:00",
            "thumbnail" to "http://1.bp.example.com/-lorem/ipsum/sit/AMEN-demo/s72-c/test.png",
            "blogger_id" to "tag:blogger.com,1999:blog-1212121212121212121212122.post-12121212121212121212121",
            "blogger_orig_url" to "http://blog.example.es/2009/05/demo-loreim-ip-sit-demo.html"
        ),
        Yaml.decode(
            """
                layout: post
                title: 'demo: 2D test demo lorem ipsum'
                title_es: 'lorem: ipsum sim de 2D te test'
                date: '2009-05-05T10:45:00.000+02:00'
                author: abc def hij
                tags:
                - lorem
                - ipsum
                feature_image: /images/2009/ipsum.png
                modified_time: '2011-05-14T15:39:49.185+02:00'
                thumbnail: http://1.bp.example.com/-lorem/ipsum/sit/AMEN-demo/s72-c/test.png
                blogger_id: tag:blogger.com,1999:blog-1212121212121212121212122.post-12121212121212121212121
                blogger_orig_url: http://blog.example.es/2009/05/demo-loreim-ip-sit-demo.html
            """.trimIndent()
        )
    )
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.