From b181fa95a0f30af9e333c06d6234909e6ded22b3 Mon Sep 17 00:00:00 2001 From: Livio Soares Date: Wed, 18 Mar 2015 23:38:28 -0400 Subject: [PATCH 1/2] OperatioView.js: fix rendering of Markdown (GFM) in description fields. This removes substitution of \r\n, \r, \n to
, since the subsequent set of renderGFM() gets confused by them. Furthermore, the marked module already does a decent job of substituting \n with proper HTML (

, if I'm not mistaken). --- src/main/javascript/view/OperationView.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/javascript/view/OperationView.js b/src/main/javascript/view/OperationView.js index ea00e0c1..274fceb5 100644 --- a/src/main/javascript/view/OperationView.js +++ b/src/main/javascript/view/OperationView.js @@ -69,9 +69,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ this.model.isReadOnly = true; } this.model.description = this.model.description || this.model.notes; - if (this.model.description) { - this.model.description = this.model.description.replace(/(?:\r\n|\r|\n)/g, '
'); - } this.model.oauth = null; modelAuths = this.model.authorizations || this.model.security; if (modelAuths) { @@ -626,4 +623,4 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({ Docs.expandOperation(elem); } } -}); \ No newline at end of file +}); From aef4574958855e80be6ab9c8178f8b7fafe92476 Mon Sep 17 00:00:00 2001 From: Livio Soares Date: Fri, 20 Mar 2015 16:37:54 -0400 Subject: [PATCH 2/2] operation.handlebars: Using a

around {{{description}}} is more robust to potential HTML tags cannot be nested within the

context. --- src/main/template/operation.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/template/operation.handlebars b/src/main/template/operation.handlebars index b443c89a..41c75e8e 100644 --- a/src/main/template/operation.handlebars +++ b/src/main/template/operation.handlebars @@ -22,7 +22,7 @@ {{/if}} {{#if description}}

Implementation Notes

-

{{{description}}}

+
{{{description}}}
{{/if}} {{#oauth}}