All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.laminext.markdown.UnsafeMarkdownReceiver.scala Maven / Gradle / Ivy

package io.laminext.markdown

import com.raquo.laminar.api.L.HtmlElement
import com.raquo.laminar.modifiers.Modifier
import io.laminext.markdown.markedjs.Marked

object UnsafeMarkdownReceiver {

  @inline def :=(markdown: String): Modifier[HtmlElement] = {
    new Modifier[HtmlElement] {
      override def apply(element: HtmlElement): Unit = element.ref.innerHTML = Marked.parse(markdown)
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy