Skip to content

Commit 2275960

Browse files
committed
Update with one more regex validation in front-end
1 parent a33893b commit 2275960

File tree

3 files changed

+2
-28
lines changed

3 files changed

+2
-28
lines changed

lib/components/app/ListForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class ListForm extends React.Component {
3434
validates(value, success, error) {
3535
if (value === '') {
3636
error('Title cannot be empty!')
37-
} else if (/\"/.test(value)) {
37+
} else if (/\"/.test(value) || /\\/.test(value)) {
3838
error('Wrong title format!')
3939
} else if (value.length > 40) {
4040
error('Maximum length: 40 characters')

lib/index.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,6 @@ axios.all(Object.keys(codeFiles).map(key => codeFiles[key]).map(file => axios.ge
3636
})
3737
}
3838
})
39-
// getCodeContent('server').then((response) => {
40-
// let code = atob(response.data.content)
41-
// const $codeBlock = document.getElementById('render-code')
42-
// const $style = document.getElementById('code-style')
43-
44-
// $codeBlock.innerText = code
45-
// hljs.highlightBlock($codeBlock)
46-
47-
// Change Style
48-
// setTimeout(() => {
49-
// $style.href = '/css/tomorrow-night-blue.css'
50-
// }, 5000)
51-
// })
5239

5340
window.addEventListener('load', function() {
5441
ReactDOM.render(

public/js/index.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10523,19 +10523,6 @@ _axios2.default.all(Object.keys(codeFiles).map(function (key) {
1052310523
}
1052410524
}
1052510525
});
10526-
// getCodeContent('server').then((response) => {
10527-
// let code = atob(response.data.content)
10528-
// const $codeBlock = document.getElementById('render-code')
10529-
// const $style = document.getElementById('code-style')
10530-
10531-
// $codeBlock.innerText = code
10532-
// hljs.highlightBlock($codeBlock)
10533-
10534-
// Change Style
10535-
// setTimeout(() => {
10536-
// $style.href = '/css/tomorrow-night-blue.css'
10537-
// }, 5000)
10538-
// })
1053910526

1054010527
window.addEventListener('load', function () {
1054110528
_reactDom2.default.render(_react2.default.createElement(_App2.default, null), document.getElementById('app'));
@@ -23660,7 +23647,7 @@ var ListForm = function (_React$Component) {
2366023647
value: function validates(value, success, error) {
2366123648
if (value === '') {
2366223649
error('Title cannot be empty!');
23663-
} else if (/\"/.test(value)) {
23650+
} else if (/\"/.test(value) || /\\/.test(value)) {
2366423651
error('Wrong title format!');
2366523652
} else if (value.length > 40) {
2366623653
error('Maximum length: 40 characters');

0 commit comments

Comments
 (0)