Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Native Render HTML: whitespace collapsing #851

Merged
merged 13 commits into from Dec 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
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
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
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
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,
})
],
});
153 changes: 135 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
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://git@github.com:Expensify/react-native-onyx.git#8e29d1807382c8a1325c92858c551f6b19e1aaad",
"react-native-render-html": "^4.2.3",
"react-native-pdf": "^6.2.2",
"react-native-render-html": "^6.0.0-alpha.8",
"react-native-safe-area-context": "^3.1.4",
"react-native-web": "^0.14.0",
"react-native-web-webview": "^1.0.2",
Expand Down
@@ -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;