Skip to content

Commit

Permalink
Merge pull request #882 from jsamr/jsamr-whitespace-collapsing
Browse files Browse the repository at this point in the history
React Native Render HTML: whitespace collapsing (2d shot)
  • Loading branch information
AndrewGable authored Dec 3, 2020
2 parents 9dd2928 + bcca418 commit 4234709
Show file tree
Hide file tree
Showing 16 changed files with 462 additions and 255 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ build/
local.properties
*.iml

# Vscode
.vscode

# node.js
#
node_modules/
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ module.exports = {
*/
exclude: [
// eslint-disable-next-line max-len
/node_modules\/(?!(react-native-render-html|react-native-webview|react-native-onyx)\/).*|\.native\.js$/,
/node_modules\/(?!(react-native-webview|react-native-onyx)\/).*|\.native\.js$/,
platformExclude
],
},
Expand Down
9 changes: 7 additions & 2 deletions config/webpack/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ module.exports = merge(common, {
plugins: [
new webpack.DefinePlugin({
__REACT_WEB_CONFIG__: JSON.stringify(env),
})
]

// React Native JavaScript environment requires the global __DEV__ variable to be accessible.
// react-native-render-html uses variable to log exclusively during development.
// See https://reactnative.dev/docs/javascript-environment
__DEV__: true,
}),
],
});
5 changes: 5 additions & 0 deletions config/webpack/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ module.exports = merge(common, {
plugins: [
new webpack.DefinePlugin({
__REACT_WEB_CONFIG__: JSON.stringify(env),

// React Native JavaScript environment requires the global __DEV__ variable to be accessible.
// react-native-render-html uses variable to log exclusively during development.
// See https://reactnative.dev/docs/javascript-environment
__DEV__: false,
})
],
});
163 changes: 145 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
"react-native-image-picker": "^2.3.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-modal": "^11.5.6",
"react-native-pdf": "^6.2.2",
"react-native-onyx": "git+https://[email protected]:Expensify/react-native-onyx.git#8e29d1807382c8a1325c92858c551f6b19e1aaad",
"react-native-render-html": "^4.2.3",
"react-native-render-html": "^6.0.0-alpha.10",
"react-native-pdf": "^6.2.2",
"react-native-safe-area-context": "^3.1.4",
"react-native-web": "^0.14.0",
"react-native-web-webview": "^1.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import PropTypes from 'prop-types';

/**
* Text based component that is passed a URL to open onPress
*/
const anchorForCommentsOnlyPropTypes = {
// The URL to open
href: PropTypes.string,

// What headers to send to the linked page (usually noopener and noreferrer)
// This is unused in native, but is here for parity with web
rel: PropTypes.string,

// Used to determine where to open a link ("_blank" is passed for a new tab)
// This is unused in native, but is here for parity with web
target: PropTypes.string,


// Any children to display
children: PropTypes.node,

// Any additional styles to apply
// eslint-disable-next-line react/forbid-prop-types
style: PropTypes.any,
};

export default anchorForCommentsOnlyPropTypes;
Loading

0 comments on commit 4234709

Please sign in to comment.