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 title chars #13

Merged
merged 4 commits into from
Sep 29, 2024
Merged

Fix title chars #13

merged 4 commits into from
Sep 29, 2024

Conversation

kovmir
Copy link
Contributor

@kovmir kovmir commented Sep 26, 2024

If # Title is the first line of a Markdown file, then swege sets <title>Title</title> as the page title.
If ### Title is used, then swege sets <title># Title</title> as the page title.

This pull request fixes that issue.

@kovmir
Copy link
Contributor Author

kovmir commented Sep 26, 2024

Please push a new tag so I can update the package.

Just reminding you to update copyright years across the repository:

$ grep -rnI 2023
swege.c:1:/* Copyright 2023 Sergei Akhmatdinov                                         */
README.md:82:Copyright 2023 Sergei Akhmatdinov

Copy link
Owner

@sakhmatd sakhmatd left a comment

Choose a reason for hiding this comment

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

Thanks for finding and fixing the issue! I suggest replacing the for loop + variable approach with strrchr, which can do the same thing.

swege.c Show resolved Hide resolved
@kovmir
Copy link
Contributor Author

kovmir commented Sep 26, 2024

Consider this example title ### The importance of # character. The use of strrchr() would result in <title>character</title>.

@sakhmatd
Copy link
Owner

Consider this example title ### The importance of # character. The use of strrchr() would result in <title>character</title>.

Ah, fair enough. I suppose the previous solution is fine then.

@kovmir
Copy link
Contributor Author

kovmir commented Sep 26, 2024

You can checkout the master branch and then git merge --squash fix-title-chars if you want.

@sakhmatd sakhmatd merged commit 3bf3bf1 into sakhmatd:master Sep 29, 2024
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