Skip to content

Commit

Permalink
feat: add text and emphasis transformers - accordproject#397
Browse files Browse the repository at this point in the history
Variable name changed
Spacing improved

Signed-off-by: k-kumar-01 <[email protected]>
  • Loading branch information
K-Kumar-01 committed Jun 11, 2021
1 parent 77a0e00 commit d5f5b36
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/markdown-docx/src/OoxmlTransformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,18 @@ class OoxmlTransformer {
$class: `${NS_PREFIX_CommonMarkModel}Softbreak`,
};
case 'w:r':
if(element.elements[0].name==='w:rPr'){
let emphFound = element.elements[0].elements.some(subElement=>{
return subElement.name==='w:i' && subElement.attributes['w:val'] === 'true';
});
if(emphFound){
if (element.elements[0].name === 'w:rPr') {
let emphasisedTextFound = element.elements[0].elements.some(
subElement => {
return subElement.name === 'w:i';
}
);
if (emphasisedTextFound) {
return {
$class: `${NS_PREFIX_CommonMarkModel}Emph`,
nodes:[...this.deserializeElements(element.elements)]
nodes: [
...this.deserializeElements(element.elements),
],
};
}
}
Expand Down

0 comments on commit d5f5b36

Please sign in to comment.