OperatioView.js: fix rendering of Markdown (GFM) in description fields.

This removes substitution of \r\n, \r, \n to <br>, 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 (<p>, if I'm not mistaken).
This commit is contained in:
Livio Soares
2015-03-18 23:38:28 -04:00
parent 38ac8428d1
commit b181fa95a0

View File

@@ -69,9 +69,6 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
this.model.isReadOnly = true; this.model.isReadOnly = true;
} }
this.model.description = this.model.description || this.model.notes; 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, '<br />');
}
this.model.oauth = null; this.model.oauth = null;
modelAuths = this.model.authorizations || this.model.security; modelAuths = this.model.authorizations || this.model.security;
if (modelAuths) { if (modelAuths) {
@@ -626,4 +623,4 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
Docs.expandOperation(elem); Docs.expandOperation(elem);
} }
} }
}); });