File tree Expand file tree Collapse file tree 4 files changed +19
-5
lines changed
Expand file tree Collapse file tree 4 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 1+ snippets
2+ tests
3+ elm-stuff
4+ dist
5+ src
6+ stylesheets
Original file line number Diff line number Diff line change 11{
2- "version" : " 2.1.0 " ,
2+ "version" : " 2.1.1 " ,
33 "summary" : " JSON viewer for elm apps" ,
44 "repository" : " https://github.com/1602/json-viewer.git" ,
55 "license" : " ISC" ,
Original file line number Diff line number Diff line change 11{
22 "name" : " json-viewer-custom-element" ,
3- "version" : " 2.1.0 " ,
3+ "version" : " 2.1.1 " ,
44 "description" : " Custom HTML element: json-viewer" ,
55 "main" : " build/custom-element.js" ,
66 "repository" : " git@github.com:1602/json-viewer.git" ,
Original file line number Diff line number Diff line change @@ -237,9 +237,17 @@ previewValue : JsonValue -> Html msg
237237previewValue v =
238238 case v of
239239 JsonValue . StringValue s ->
240- toString s
241- |> text
242- |> inline JsonString
240+ let
241+ strLen =
242+ String . length s
243+ in
244+ ( if strLen > 100 then
245+ ( String . left 50 s) ++ " …" ++ ( String . right 49 s)
246+ else
247+ toString s
248+ )
249+ |> text
250+ |> inline JsonString
243251
244252 JsonValue . NullValue ->
245253 " null"
You can’t perform that action at this time.
0 commit comments