0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 09:12:45 +00:00

Shift CSS processing from newPage.jsx/save to homebrew.api.js/newBrew, as this function is only called when saving new Brews.

This commit is contained in:
G.Ambatte
2021-06-21 19:38:02 +12:00
parent b72191ae68
commit 2613d43f3c
2 changed files with 9 additions and 8 deletions

View File

@@ -135,14 +135,7 @@ const NewPage = createClass({
});
console.log('saving new brew');
// Split out CSS to Style if CSS codefence exists
if(brew.text.startsWith('```css') && brew.text.indexOf('```\n\n') > 0) {
const index = brew.text.indexOf('```\n\n');
brew.style = `${brew.style}\n${brew.text.slice(7, index - 1)}`;
brew.text = brew.text.slice(index + 5);
}
if(this.state.saveGoogle) {
const res = await request
.post('/api/newGoogle/')