Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Add support for (soft) wrap parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Siavash Safi committed Sep 15, 2017
1 parent eff7c33 commit c4f7137
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/catawiki/jira/prism/Code.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public String execute(Map<String, Object> parameters, String body, RenderContext
templateParams.put("linenumbers", true);
}

// wrap (optional)
if (parameters.containsValue("wrap")) {
templateParams.put("wrap", true);
}

for (Map.Entry<String, Object> entry : parameters.entrySet()) {
switch (entry.getKey()) {
case "language":
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/soy/prism.soy
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* @param? language
* @param? title
* @param? linenumbers
* @param? wrap
* @param? highlight
* @param? commandline
* @param? user
Expand All @@ -15,6 +16,7 @@
<pre
{if $title} data-line-offset="-1.7" {/if}
{if $linenumbers} class="line-numbers" {/if}
{if $wrap} style="white-space: pre-wrap;" {/if}
{if $highlight} data-line="{$highlight}" {/if}
{if $commandline} class="command-line" {/if}
{if $user} data-user="{$user}" {/if}
Expand Down

0 comments on commit c4f7137

Please sign in to comment.