Skip to content

Commit

Permalink
Remove breaks around images
Browse files Browse the repository at this point in the history
  • Loading branch information
ggodlewski committed Feb 16, 2024
1 parent 1fd255e commit a54b235
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/odt/postprocess/addEmptyLines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export function addEmptyLines(markdownChunks: MarkdownChunks) {
for (let position = 0; position < markdownChunks.length; position++) {
const chunk = markdownChunks.chunks[position];

if (position + 1 < markdownChunks.chunks.length && chunk.isTag && ['/H1', '/H2', '/H3', '/H4', 'IMG/', 'SVG/', '/UL'].indexOf(chunk.tag) > -1) {
if (position + 1 < markdownChunks.chunks.length && chunk.isTag && ['/H1', '/H2', '/H3', '/H4', 'SVG/', '/UL'].indexOf(chunk.tag) > -1) {
const nextTag = markdownChunks.chunks[position + 1];

if (!(nextTag.isTag && nextTag.tag === 'BR/') && !(nextTag.isTag && nextTag.tag === '/TD')) {
Expand All @@ -19,10 +19,10 @@ export function addEmptyLines(markdownChunks: MarkdownChunks) {
}
}

if (position > 1 && chunk.isTag && ['H1', 'H2', 'H3', 'H4', 'IMG/', 'SVG/', 'UL'].indexOf(chunk.tag) > -1) {
if (position > 1 && chunk.isTag && ['H1', 'H2', 'H3', 'H4', 'SVG/', 'UL'].indexOf(chunk.tag) > -1) {
const prevTag = markdownChunks.chunks[position - 1];
if (!(prevTag.isTag && prevTag.tag === 'BR/') && !(prevTag.isTag && prevTag.tag === 'TD')) {
markdownChunks.chunks.splice(position - 1, 0, {
markdownChunks.chunks.splice(position, 0, {
isTag: false,
mode: 'md',
text: '\n',
Expand Down
3 changes: 2 additions & 1 deletion src/odt/postprocess/addIndentsAndBullets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export function addIndentsAndBullets(markdownChunks: MarkdownChunks) {
markdownChunks.chunks.splice(position2, 0, {
mode: 'md',
isTag: false,
text: prevEmptyLine === 1 ? firstStr : otherStr
text: prevEmptyLine === 1 ? firstStr : otherStr,
comment: 'Indent or bullet'
});
prevEmptyLine = 0;
position2++;
Expand Down
6 changes: 2 additions & 4 deletions test/odt_md/issue-435-436.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ Similar to adding a new question, users must have the proper permission to modif
3. Click the <strong>?Show Questions</strong> button
4. Locate the question to update and click on the row.

![](10000001000001AE0000013A3DD8D81D5AC3DDAE.png)
![](10000001000001AE0000013A3DD8D81D5AC3DDAE.png)

5. From here, you may update the Description, the process order, the question code, or the response.
1. You may not change this from one "type" of response (like Text) to another type (like Yes/No). For this type of change, create a new question.
2. Be sure to click the Submit button at the bottom to save your changes.

![](10000001000003C90000010BE8F0122D00285531.png)
2. Be sure to click the Submit button at the bottom to save your changes.![](10000001000003C90000010BE8F0122D00285531.png)

0 comments on commit a54b235

Please sign in to comment.