Skip to content

Commit

Permalink
Dispaly the description of the projects again
Browse files Browse the repository at this point in the history
  * updating `innerHTML` not working since elm@0.19.0:
  elm/html#172
  * used proper HTML parsing from string to generate nodes
  * correct unparsable description
  • Loading branch information
Pamplemousse committed May 23, 2020
1 parent d1e1298 commit f64d937
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions back/models/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"dates": "may 2018 - today",
"tags": "web security, javascript, R&D",
"links": [{
"target": "internship_report_2018.pdf",
"value": "See my internship report for a more in depth presentation"
"target": "https://blog.xaviermaso.com/2018/10/01/Scanning-modern-web-applications-with-OWASP-ZAP.html",
"value": "See the write-up on my blog for a more in-depth presentation."
}],
"description": "Intern at Mozilla during the summer of 2018 in the <a href='https://wiki.mozilla.org/Security/FirefoxOperations' target='_blank'>FoxSec</a> team. I worked on improving <a href='https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project'>OWASP ZAP</a>, for it to be able to scan \"modern\" web applications.<br/>The effort has been focused around two keys areas: write the <a href='https://github.com/zaproxy/zaproxy/issues/4939' target='_blank'>FrontEndScanner addon</a> (not yet released) for ZAP to allow users to run \"client-side scripts\"; and create a front-end library to help debug modern web pages: the <a href='https://www.npmjs.com/package/@zaproxy/front-end-tracker' target='_blank'>@zaproxy/front-end-tracker."
"description": "Intern at Mozilla during the summer of 2018 in the <a href='https://wiki.mozilla.org/Security/FirefoxOperations' target='_blank'>FoxSec</a> team. I worked on improving <a href='https://www.owasp.org/index.php/OWASP_Zed_Attack_Proxy_Project'>OWASP ZAP</a>, for it to be able to scan \"modern\" web applications.<br/>The effort has been focused around two keys areas: write the <a href='https://github.com/zaproxy/zaproxy/issues/4939' target='_blank'>FrontEndScanner addon</a> (not yet released) for ZAP to allow users to run \"client-side scripts\"; and create a front-end library to help debug modern web pages: the <a href='https://www.npmjs.com/package/@zaproxy/front-end-tracker' target='_blank'>@zaproxy/front-end-tracker</a>."
}, {
"id": "1",
"tileContent": "redshield",
Expand Down
5 changes: 4 additions & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@
"elm/url": "1.0.0",
"elm-community/list-extra": "8.1.0",
"elm-explorations/markdown": "1.0.0",
"hecrj/html-parser": "2.3.4",
"krisajenkins/remotedata": "5.0.0"
},
"indirect": {
"elm/parser": "1.1.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2"
"elm/virtual-dom": "1.0.2",
"rtfeldman/elm-hex": "1.0.0"
}
},
"test-dependencies": {
Expand Down
21 changes: 12 additions & 9 deletions front/elm/Projects/Show.elm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ module Projects.Show exposing (formatLink, view)
import Html exposing (..)
import Html.Attributes exposing (class, href, id, property, style, target)
import Html.Events exposing (onClick)
import Html.Parser exposing (run)
import Html.Parser.Util exposing (toVirtualDom)
import Json.Encode exposing (string)
import Messages exposing (..)
import Projects.Models exposing (Link, Project)
Expand All @@ -11,13 +13,16 @@ import Projects.Models exposing (Link, Project)
view : Project -> Html Msg
view project =
let
descriptionValue =
descriptionNode =
case project.description of
Nothing ->
""

Just description ->
description
case Html.Parser.run description of
Ok parsedNodes ->
Html.Parser.Util.toVirtualDom parsedNodes
_ ->
[]
Nothing ->
[]
in
div [ class "row" ]
[ div [ class "col-md-12" ]
Expand All @@ -32,10 +37,8 @@ view project =
, h4 [] [ text project.tags ]
, div [ class "row" ]
[ div
[ class "col-md-12 textDesc"
, property "innerHTML" <| string descriptionValue
]
[]
[ class "col-md-12 textDesc" ]
descriptionNode
]
, div [] (List.map formatLink project.links)
, i
Expand Down

0 comments on commit f64d937

Please sign in to comment.