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

Fix headline bug and add image support #5

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Astrian
Copy link

@Astrian Astrian commented Sep 7, 2024

  • Add image tags support
  • Add DIV tags support (will be tricked as general paragraph)
  • Fix a problem with the lack of \n\n before the headline so that the headline may be rendered to the last paragraph

BTW. The Xcode 16.0 reports an error indicating that the firstMatch(in: _) function may not be available in lower than iOS 16 (Sources/SwiftHTMLtoMarkdown/BasicHTML.swift:98). I have no idea if it is a critical issue because I have no errors encountered when I use this library with network reference. The error appears when I clone the library to the local and import it as a local library.

Here is a suggested fix authored by Xcode:

image

Copy link
Owner

@ActuallyTaylor ActuallyTaylor left a comment

Choose a reason for hiding this comment

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

Looks good to me :)

@ActuallyTaylor
Copy link
Owner

Thank you for making this PR! What are the changes to the Headers? I am seeing tests for those failing so I am wondering if the tests are incorrect because output was originally flawed.

@Astrian
Copy link
Author

Astrian commented Sep 10, 2024

Thank you for making this PR! What are the changes to the Headers? I am seeing tests for those failing so I am wondering if the tests are incorrect because output was originally flawed.

The headline will be rendered as a part of its last block (paragraph), not a single block, like this (all ##s should be h2 marks):

image

I doubt if it is an issue leading with the iOS SDK version. It may also cause the firstMatch (in: _) error I mentioned before, which will appear when I import the library directly from the cloned one instead of the GitHub repository. It may be evidence that there is no issue on your side with the last version of the code, for I am using Xcode beta version (16.0)

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