Skip to content

Commit

Permalink
Fixed parsing for first cell in .fods documents
Browse files Browse the repository at this point in the history
  • Loading branch information
fedelway committed Oct 26, 2020
1 parent 6ecfeb6 commit eec93b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bits/80_parseods.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ var parse_content_xml = (function() {
case 'scripts': // 3.12 <office:scripts>
case 'styles': // TODO <office:styles>
case 'font-face-decls': // 3.14 <office:font-face-decls>
case 'master-styles': //3.15.4 <office:master-styles> -- relevant for FODS
if(Rn[1]==='/'){if((tmp=state.pop())[0]!==Rn[3]) throw "Bad state: "+tmp;}
else if(Rn[0].charAt(Rn[0].length-2) !== '/') state.push([Rn[3], true]);
break;
Expand Down Expand Up @@ -285,7 +286,6 @@ var parse_content_xml = (function() {
case 'script': break; // 3.13 <office:script>
case 'libraries': break; // TODO: <ooo:libraries>
case 'automatic-styles': break; // 3.15.3 <office:automatic-styles>
case 'master-styles': break; // TODO: <office:master-styles>

case 'default-style': // TODO: <style:default-style>
case 'page-layout': break; // TODO: <style:page-layout>
Expand Down Expand Up @@ -382,6 +382,7 @@ var parse_content_xml = (function() {
case 'line-break': break; // 6.1.5 <text:line-break>
case 'span': break; // 6.1.7 <text:span>
case 'p': case '文本串': // 5.1.3 <text:p>
if(['master-styles'].indexOf(state[satte.length-1][0]) > -1) break;
if(Rn[1]==='/' && (!ctag || !ctag['string-value'])) {
var ptp = parse_text_p(str.slice(textpidx,Rn.index), textptag);
textp = (textp.length > 0 ? textp + "\n" : "") + ptp[0];
Expand Down

0 comments on commit eec93b0

Please sign in to comment.