Reputation: 36309
Fairly simple question, how can I replace \n
with {br}
between two <blockquote>
and </blockquote>
tags?
thought this would work, but it doesn't:
val = val.replace(/<blockquote>\b\n\b<\/blockquote>/igm, "{br}");
Upvotes: 0
Views: 120
Reputation: 324630
Use a replacement callback:
val = val.replace(
/<blockquote>[\s\S]*?<\/blockquote>/i,
function(m) {return m.replace(/\n/g,"{br}");}
);
Upvotes: 4