Permalink
Browse files

Issue 49055: Use urlizetrunc instead of urlize to preserve layout whe…

…n rendering long URLs.

git-svn-id: http://rietveld.googlecode.com/svn/trunk@412 e30e9e8f-1b4c-0410-881d-6f13584adfe0
  • Loading branch information...
albrecht.andi
albrecht.andi committed Apr 23, 2009
1 parent 6540485 commit ce6b99fdfd6a7659d0690a21deaabb87c98e6dfb
Showing with 6 additions and 7 deletions.
  1. +2 −3 static/script.js
  2. +1 −1 templates/inline_comment.html
  3. +2 −2 templates/issue.html
  4. +1 −1 templates/publish.html
View
@@ -1281,9 +1281,8 @@ function M_setValueFromDivs(divs, text) {
lines = lines.concat(divs[i].innerHTML.split("\n"));
}
for (var i = 0; i < lines.length; i++) {
// Undo the <a> tags added by urlize and enliven
lines[i] = lines[i].replace(/<a[^>]*>/ig, "");
lines[i] = lines[i].replace(/<\/a>/ig, "");
// Undo the <a> tags added by urlize and urlizetrunc
lines[i] = lines[i].replace(/<a (.*?)href=[\'\"]([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/ig, '$2');
// Undo the escape Django filter
lines[i] = lines[i].replace(/&gt;/ig, ">");
lines[i] = lines[i].replace(/&lt;/ig, "<");
@@ -21,7 +21,7 @@
id="comment-text-{{forloop.parentloop.counter0}}-{{lineno}}-{{side}}-{{forloop.counter0}}"
class="{%if bucket.quoted%}comment-text-quoted{%else%}comment-text{%endif%}"
{%if bucket.quoted%}style="display: none"{%endif%}
>{{bucket.text|wordwrap:"80"|escape|urlize}}</div>
>{{bucket.text|wordwrap:"80"|escape|urlizetrunc:80}}</div>
{%endfor%}
{%if c.draft%}
<a name="comment-reply"
View
@@ -21,7 +21,7 @@ <h3><a id="issue-description-pointer"
class="toggled-section opentriangle">
Description</a></h3>
<div id="issue-description" style="margin-left:15px;">
<pre>{{issue.description|wordwrap:80|urlize}}</pre>
<pre>{{issue.description|wordwrap:80|urlizetrunc:80}}</pre>
</div>
{%endif%}
@@ -141,7 +141,7 @@ <h3>
{%if forloop.last%}{%else%}style="display: none;"{%endif%}>
<div class="message-body">
<pre name="cl-message-{{forloop.counter0}}"
>{{message.text|wordwrap:80|urlize}}</pre>
>{{message.text|wordwrap:80|urlizetrunc:80}}</pre>
</div>
<div class="message-actions">
{%if user%}
View
@@ -48,7 +48,7 @@ <h2>Publish + Mail Draft Comments</h2>
{%if preview%}
<div style="margin-top: 3em;">
<h3>Unpublished Drafts:</h3>
<pre class="description">{{preview|wordwrap:"80"|urlize}}</pre>
<pre class="description">{{preview|wordwrap:"80"|urlizetrunc:80}}</pre>
</div>
{%endif%}
<div style="clear:both"></div>

0 comments on commit ce6b99f

Please sign in to comment.