Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replace unicode ellipsis with ASCII ellipsis (three dots)
Stick to ASCII in the source code to avoid potential cross-browser compatibility and charset issues.
  • Loading branch information
sompylasar committed Sep 8, 2018
commit 8b9be96305379107c198b08a0719de01655b357d
4 changes: 2 additions & 2 deletions packages/react-dom/src/__tests__/ReactMount-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ describe('ReactMount', () => {
' <!-- -->\n' +
" {' '}\n" +
'- <p>children <b>text</b></p>\n' +
"+ <div>{['children ', ]}</div>\n" +
"+ <div>{['children ', ...]}</div>\n" +
' </div>\n\n' +
' in div (at **)\n' +
' in Component (at **)',
Expand Down Expand Up @@ -356,7 +356,7 @@ describe('ReactMount', () => {
' <!-- -->\n' +
" {' '}\n" +
' <p>children <b>text</b></p>\n' +
"+ <div>{['children ', ]}</div>\n" +
"+ <div>{['children ', ...]}</div>\n" +
' </div>\n\n' +
' in div (at **)\n' +
' in Component (at **)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ describe('rendering React components at document', () => {
' <head>\n' +
'- <meta charset="utf-8" />\n' +
' <title>test doc long title long title long title long title long title' +
' long title long title long title lon</title>\n' +
' long title long title long title lon...</title>\n' +
' </head>\n\n' +
' in title (at **)\n' +
' in head (at **)\n' +
Expand Down
14 changes: 7 additions & 7 deletions packages/react-dom/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ const HTML = '__html';
const {html: HTML_NAMESPACE} = Namespaces;

let getTextContentSignature = (textContent: string) => '';
let getNodeSignatureForDiff = (node: Node, openTagOnly = false) => '<>';
let getNodeSignatureForMessage = (node: Node) => '<>';
let getTagWithPropsSignature = (tag: string, props: Object) => '<>';
let getNodeSignatureForDiff = (node: Node, openTagOnly = false) => '<...>';
let getNodeSignatureForMessage = (node: Node) => '<...>';
let getTagWithPropsSignature = (tag: string, props: Object) => '<...>';
let getNodeSurroundingsAndDiff = (
parentNode: Element | Document,
deletedIndex: number,
Expand Down Expand Up @@ -98,7 +98,7 @@ if (__DEV__) {

const clipStringWithEllipsis = function(str: string, clipAtLength: number) {
return (
str.substring(0, clipAtLength) + (str.length > clipAtLength ? '' : '')
str.substring(0, clipAtLength) + (str.length > clipAtLength ? '...' : '')
);
};

Expand Down Expand Up @@ -207,7 +207,7 @@ if (__DEV__) {
}
let markup = null;
if (propKey === STYLE) {
markup = propKey + '={}';
markup = propKey + '={...}';
} else if (typeof propValue === 'function') {
markup = propKey + '={' + propValue.name || propValue.toString() + '}';
} else {
Expand Down Expand Up @@ -237,12 +237,12 @@ if (__DEV__) {
if (typeof child === 'string') {
ret += "'" + child + "'";
} else {
ret += '';
ret += '...';
}
}
ret += ']}</';
} else if (props.children) {
ret += '>{}</';
ret += '>{...}</';
} else {
ret += '></';
}
Expand Down