Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop MergeListTag filter #28

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

otakumesi
Copy link
Contributor

@otakumesi otakumesi commented Nov 8, 2023

Add MergeListTag into filters.

This filter merges consecutive paragraphs including the li and option tag.

When scanning a paragraph list and there are adjacent paragraphs containing li / option tags, merge them into the paragraph on the right and add a remove sign to the paragraph on the left.

@otakumesi
Copy link
Contributor Author

otakumesi commented Nov 8, 2023

Related to #10


if (isAccteptedTags && paragraph.path == nextParagraph.path) {
val mergedParagraph = nextParagraph.copy(
text = List(paragraph.text, nextParagraph.text)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line will have O(n^2) complexity because strings are immutable in Java. Should not still cause much problems I think.

Copy link
Contributor Author

@otakumesi otakumesi Nov 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I can afford to change this line after completing various tasks, I refactor it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we are OK with leaving it as is because

  1. Lists should not be very large
  2. Individual strings are not 1 character long

@eiennohito eiennohito merged commit 5006f5e into WorksApplications:main Nov 16, 2023
2 checks passed
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.

2 participants