Skip to content

Commit

Permalink
Improved markdown rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
wakaleo committed Dec 22, 2016
1 parent fdc98fb commit 89f9c42
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class Formatter {
private static final String ELIPSE = "…";
private static final String ASCIIDOC = "asciidoc";
private static final String MARKDOWN = "markdown";
private static final String TEXT = "";
private static final String NEW_LINE = "\n";

private final static String NEWLINE_CHAR = "\u2424";
Expand Down Expand Up @@ -83,8 +84,14 @@ public String renderMarkdown(String text) {
}

private String stripSurroundingParagraphTagsFrom(String text) {
return text.toLowerCase().startsWith("<p>") ?
text.substring(3, text.length() - 5) : text;
if (text.toLowerCase().startsWith("<p>")) {
text = text.substring(3);
}

if (text.toLowerCase().endsWith("</p>")) {
text = text.substring(0, text.length() - 4);
}
return text;
}

private String stripNewLines(String render) {
Expand Down Expand Up @@ -181,7 +188,7 @@ public String addLinks(final String value) {


public String renderDescription(final String text) {
String format = environmentVariables.getProperty(ThucydidesSystemProperty.NARRATIVE_FORMAT,"");
String format = environmentVariables.getProperty(ThucydidesSystemProperty.NARRATIVE_FORMAT, TEXT);

if (isRenderedHtml(text)) {
return text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ private String normalizedLine(String nextLine) {

private boolean thereIsUsefulInformationIn(String nextLine) {
String normalizedText = normalizedLine(nextLine);
return !normalizedText.isEmpty()
&& !normalizedText.startsWith("#")
return !normalizedText.startsWith("#")
&& !normalizedText.startsWith("meta:")
&& !normalizedText.startsWith("background:")
&& !(normalizedText.startsWith("@")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ font-family:euphemia, verdana, sans-serif; font-size:16px; color: #88a717; font-
border-radius: 10px;
}

.requirementNarrativeTitle ul,ol,dl {
margin-left: 40px;
}

#accordion ul {
list-style: none;
padding: 0 0 0 0;
Expand Down

0 comments on commit 89f9c42

Please sign in to comment.