Skip to content

Commit

Permalink
modify section and paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Jun 3, 2017
1 parent 7e311da commit 60c1165
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ function parseJsonToMarkdown(jsonStr) {
if (story.subtitle) {
story.markdown.push('\n## ' + story.subtile);
}

const paragraphs = story.paragraphs;
for (let i = 0; i < paragraphs.length; i ++) {
if (sections[i]) {
story.markdown.push(sections[i]);
Expand All @@ -69,7 +71,7 @@ function parseJsonToMarkdown(jsonStr) {
}

function processSection(s) {
let setion = '';
let section = '';
if (s.backgroundImage) {
const imageWidth = parseInt(s.backgroundImage.originalWidth, 10);
const imageSrc = MEDIYM_IMG_CDN + Math.max(imageWidth*2, 2000) + '/' + s.backgroundImage.id;
Expand Down Expand Up @@ -137,7 +139,7 @@ function processParagraph(p) {
}

p.text = markup + p.text;
if (p.alignment === 2 && p.type != 6 && p.type !==7) {
if (p.alignment === 2 && p.type !== 6 && p.type !==7) {
p.text = '<center>' + p.text + '</center>';
return p.text;
}
Expand Down

0 comments on commit 60c1165

Please sign in to comment.