mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-05 01:32:47 +00:00
Try to account for situations where the URL folding is past the max length for the truncation so the user can see why this is a fold.
Remove missed debug messages.
This commit is contained in:
@@ -437,9 +437,13 @@ const CodeEditor = createClass({
|
|||||||
text = text.replace('{', '').trim();
|
text = text.replace('{', '').trim();
|
||||||
|
|
||||||
// Extra data url chomping
|
// Extra data url chomping
|
||||||
console.log(text);
|
// Try to make it pretty...
|
||||||
text = text.indexOf('data:') > -1 ? `${text.slice(0, text.indexOf('data:') + 5)} ...` : text;
|
const startOfData = text.indexOf('data:');
|
||||||
console.log(text);
|
if(startOfData) {
|
||||||
|
text = (startOfData > maxLength) ?
|
||||||
|
`${text.slice(0, text.indexOf(':') + 1)} ... ${text.slice(startOfData, startOfData + 5)} ...` :
|
||||||
|
`${text.slice(0, text.indexOf('data:') + 5)} ...`;
|
||||||
|
}
|
||||||
|
|
||||||
if(text.length > maxLength)
|
if(text.length > maxLength)
|
||||||
text = `${text.slice(0, maxLength)}...`;
|
text = `${text.slice(0, maxLength)}...`;
|
||||||
|
|||||||
Reference in New Issue
Block a user