Skip to content

fix(android): keep consecutive code blocks apart in the HTML export - #1073

Draft
jnowakow wants to merge 1 commit into
fix/android-list-item-code-blockfrom
fix/android-list-item-code-block-html-merge
Draft

jnowakow wants to merge 1 commit into
fix/android-list-item-code-blockfrom
fix/android-list-item-code-block-html-merge

Conversation

@jnowakow

Copy link
Copy Markdown
Collaborator

What/Why?

Stacked on #1065. In the HTML export, two code blocks in a row inside a list item or a quote came out as a single <pre>:

- Item

  ```
  one
  ```

  ```
  two
  ```

#1065 skips the empty bottom-margin line a code block leaves inside a list item or a quote, so it doesn't export an empty <li> or <p>. That line used to close the open code block, so after the skip the next block's lines were appended to the same <pre>. The code block is now closed before the line is skipped, as Copilot suggested in #1065 (comment).

Testing

New Robolectric test ListChildrenExportTest.keepsConsecutiveCodeBlocksApartInHtml, covering the list item and quote cases. It fails without the fix.

./gradlew :ui:testDebugUnitTest and ./gradlew ktlintCheck pass.

PR Checklist

  • Code compiles and runs on iOS
  • Code compiles and runs on Android
  • Updated documentation/README if applicable
  • Ran example app to verify changes
  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

The bottom-margin line between two code blocks in a list item or a quote was skipped
without closing the open code block, so both blocks were exported as one <pre>. Close it
before skipping the line.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant