From 33004e51dc133e8ec4066043e8680963f8b18042 Mon Sep 17 00:00:00 2001 From: u-e Date: Tue, 26 Feb 2019 22:06:25 +0300 Subject: [PATCH] fixed jpeg image also steampeak url --- src/components/postElements/body/view/postBodyStyles.js | 1 + src/components/postElements/body/view/postBodyView.js | 2 +- src/utils/markdownToHtml.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/postElements/body/view/postBodyStyles.js b/src/components/postElements/body/view/postBodyStyles.js index 778d7e85c..0e29846d3 100644 --- a/src/components/postElements/body/view/postBodyStyles.js +++ b/src/components/postElements/body/view/postBodyStyles.js @@ -17,6 +17,7 @@ export default EStyleSheet.create({ img: { // height: 50, marginTop: 10, + // left: -15, }, commentContainer: { paddingHorizontal: 0, diff --git a/src/components/postElements/body/view/postBodyView.js b/src/components/postElements/body/view/postBodyView.js index 8cfb53d40..15faa06c6 100644 --- a/src/components/postElements/body/view/postBodyView.js +++ b/src/components/postElements/body/view/postBodyView.js @@ -62,7 +62,7 @@ class PostBody extends PureComponent { url.indexOf('esteem') > -1 || url.indexOf('steemit') > -1 || url.indexOf('busy') > -1 - || url.indexOf('steempeak') > -1 + || (url.indexOf('steempeak') > -1 && url.indexOf('files') < 0) ) { url = url.substring(url.indexOf('@'), url.length); const routeParams = url.indexOf('/') > -1 ? url.split('/') : [url]; diff --git a/src/utils/markdownToHtml.js b/src/utils/markdownToHtml.js index da03d71e1..e48beaf9b 100644 --- a/src/utils/markdownToHtml.js +++ b/src/utils/markdownToHtml.js @@ -15,7 +15,7 @@ const dTubeRegex = /(https?:\/\/d.tube.#!\/v\/)(\w+)\/(\w+)/g; const authorNameRegex = /(^|[^a-zA-Z0-9_!#$%&*@@\/]|(^|[^a-zA-Z0-9_+~.-\/]))[@@]([a-z][-\.a-z\d]+[a-z\d])/gi; const tagsRegex = /(^|\s|>)(#[-a-z\d]+)/gi; const centerRegex = /(
)/g; -const imgRegex = /(https?:\/\/.*\.(?:tiff?|jpe?g|gif|png|svg|ico|PNG|GIF|JPG))/g; +const imgRegex = /(https?:\/\/.*\.(?:tiff?|jpe?g|gif|png|svg|ico|PNG|GIF|JPG|JPEG))/g; const linkRegex = /[-a-zA-Z0-9@:%+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%+._~#?&//=]*)?/gi; const markdownImageRegex = /!\[[^\]]*\]\((.*?)\s*("(?:.*[^"])")?\s*\)/g; const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])?/gm; @@ -257,8 +257,8 @@ const createVimeoIframe = input => input.replace(vimeoRegex, (link) => { const handleImageLink = input => input.replace(imgRegex, link => imageBody(link)); const iframeBody = link => ``; -const imageBody = link => `
`; -const gifBody = link => ``; +const imageBody = link => `
`; +const gifBody = link => ``; // const handleCodeTag = input => input.replace(codeTagRegex, (tag) => { // const stringsRegex = /(?<=>)(.*)(?=<)/g;