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

implemented URL dictionary with complete error checking #108

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

bam93
Copy link

@bam93 bam93 commented Mar 10, 2024

Following our discussion in this thread, I created a pull request for the corresponding code changes. The only user-configuration would be the LINKDEFS_STRICT_CHECKING constant set in both of the modified files.

I also had to change some regular expressions (and extend with new ones). I think I improved their robustness, because for instance having two link definitions on the same line/paragraph was not handled in some of the REGEXP.

In org parser, I create self.__entry_data.('linkdefs') for each blog article with "#+LINK" entries. This data then populates, in htmlizer, the "dict_of_links" dictionary that is used to check whether a given [[tag][link]] or [[tag]] needs to be expanded. This happens in the functions sanitizing URLs.

These tag shortcuts should work in normal blog articles and bulleted lists. Other sections handed off to eg pypandoc (probably tables?) would need to be implemented separately, like I did for bulleted "list"s. I will certainly do that, but only whenever I need it.

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