liveview-native / live_view_native_stylesheet

MIT License
10 stars 4 forks source link

style parser can't handle markdown code cells in a livebook #73

Closed BrooklinJazz closed 2 months ago

BrooklinJazz commented 2 months ago

The following code within a livebook in a markdown cell causes the parser to crash.

```elixir \<Text>Hamlet\<\/Text> ```

Here's the error the crash produces:

11:44:02.071 [error] Process #PID<0.5854.0> on node :"ukzqlkcf-livebook_je35ts2z@brooklin" raised an exception
** (ArgumentError) errors were found at the given arguments:

  * 2nd argument: not a tuple

    :erlang.element(2, nil)
    (live_view_native_stylesheet 0.3.0-rc.1) lib/live_view_native/stylesheet/extractor.ex:119: LiveViewNative.Stylesheet.Extractor.extract_templates/1
    (elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.16.2) lib/enum.ex:1700: Enum."-map/2-lists^map/1-1-"/2
    (server 0.1.0) lib/server/attribute_parsers/style.ex:5: Server.AttributeParsers.Style.parse/2
    (live_view_native_stylesheet 0.3.0-rc.1) lib/live_view_native/stylesheet/extractor.ex:89: anonymous fn/2 in LiveViewNative.Stylesheet.Extractor.run/1
    (elixir 1.16.2) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
    (live_view_native_stylesheet 0.3.0-rc.1) lib/live_view_native/stylesheet/extractor.ex:78: LiveViewNative.Stylesheet.Extractor.run/1
11:44:02.076 [error] GenServer #PID<28528.145.0> terminating
bcardarella commented 2 months ago

Closed with 9630fac91cb207448d6b1d7ccc3b39ee814b2108