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

Basic Inline math not showing #22

Open
Tanneguy opened this issue Dec 11, 2020 · 0 comments
Open

Basic Inline math not showing #22

Tanneguy opened this issue Dec 11, 2020 · 0 comments

Comments

@Tanneguy
Copy link

Tanneguy commented Dec 11, 2020

Hi Jim, I can't get the basic example to work : inline math is not displayed.
I have made the simplest functioning code I can think of to showcase the issue, because I can't see what I am doing wrong.
FYI we will be using extensively the parsing / rendering part of the module.

module Main exposing (..)

import Browser
import Html exposing (Html, div)
import Markdown.Option exposing (MarkdownOption(..))
import Markdown.Render as Mkdn exposing (MarkdownMsg)

type alias Model =
    String

init : ( Model, Cmd Msg )
init =
    ( math, Cmd.none )

math =
    " This is inline math : $ a^2 + b^2 = c^2 $ "

type Msg
    = MkdnMsg Mkdn.MarkdownMsg

update : Msg -> Model -> ( Model, Cmd Msg )
update _ model =
            ( model, Cmd.none )

view : Model -> Html Msg
view model =
    div []
        [ Mkdn.toHtml ExtendedMath model |> Html.map MkdnMsg ]

main : Program () Model Msg
main =
    Browser.element
        { view = view
        , init = \_ -> init
        , update = update
        , subscriptions = always Sub.none
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant