Skip to content

Commit

Permalink
intro text spacing correction
Browse files Browse the repository at this point in the history
  • Loading branch information
mauryakrishna committed Jun 6, 2021
1 parent f5af716 commit 5a443b6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
24 changes: 15 additions & 9 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"mysql2": "2.1.0",
"nodemailer": "6.4.11",
"nodemailer-ses-transport": "1.5.1",
"slate": "^0.62.0",
"slate": "^0.63.0",
"slugify": "1.4.0"
}
}
4 changes: 3 additions & 1 deletion src/utils/getexperienceintrotext.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import { Node } from 'slate';
const FEATURED_TEXT_LENGTH = 140;

const serialize = nodes => {
let nodeString = []
let text = ""
for(const node of nodes || []) {
text += Node.string(node)
nodeString.push(Node.string(node))
text = nodeString.join(" ")
if(text.length>FEATURED_TEXT_LENGTH) {
text = `${text.slice(0, FEATURED_TEXT_LENGTH).trim()}...`
break;
Expand Down

0 comments on commit 5a443b6

Please sign in to comment.