Skip to content

Commit a786e5e

Browse files
committed
fix: report titles
1 parent 79747c8 commit a786e5e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Valentine is a real-time collaborative threat modeling tool that combines human
66

77
![Screenshot of a data flow diagram in Valentine](screenshots/data_flow_diagram.png)
88

9-
IMPORTANT: This project is still missing feature and has bugs. Please review the [issues](https://github.com/maxneuvians/valentine/issues) for more information.
9+
IMPORTANT: This project is undergoing active development and may experience breaking changes. This project is also still missing feature and has bugs. Please review the [issues](https://github.com/maxneuvians/valentine/issues) for more information.
1010

1111
## Features
1212

valentine/lib/valentine_web/live/workspace_live/threat_model/components/report_component.ex

+11-2
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ defmodule ValentineWeb.WorkspaceLive.ThreatModel.Components.ReportComponent do
2727
</ol>
2828
2929
<h3 id="application_information">1. {gettext("Application Information")}</h3>
30-
{optional_content(@workspace.application_information) |> Phoenix.HTML.raw()}
30+
{optional_content(@workspace.application_information)
31+
|> reduce_titles_in_content()
32+
|> Phoenix.HTML.raw()}
3133
3234
<h3 id="architecture">2. {gettext("Architecture")}</h3>
33-
{optional_content(@workspace.architecture) |> Phoenix.HTML.raw()}
35+
{optional_content(@workspace.architecture) |> reduce_titles_in_content() |> Phoenix.HTML.raw()}
3436
3537
<h3 id="data_flow_diagram">3. {gettext("Data Flow")}</h3>
3638
<.box
@@ -274,6 +276,13 @@ defmodule ValentineWeb.WorkspaceLive.ThreatModel.Components.ReportComponent do
274276
defp optional_content(nil), do: "<i>Not set</i>"
275277
defp optional_content(model), do: model.content
276278

279+
defp reduce_titles_in_content(content) do
280+
content
281+
|> String.replace(~r/h1\>/, "h4>")
282+
|> String.replace(~r/h2\>/, "h5>")
283+
|> String.replace(~r/h3\>/, "h6>")
284+
end
285+
277286
defp stride_to_letter(nil), do: ""
278287

279288
defp stride_to_letter(data) do

0 commit comments

Comments
 (0)