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

WIP: Fix image alt text when it has double quotes #443

Closed
wants to merge 1 commit into from

Conversation

ramiro
Copy link

@ramiro ramiro commented Aug 23, 2023

No description provided.

@@ -1765,6 +1765,11 @@ def class_string node
def role_valid_class? role
role.is_a? String
end

def encode_alt_text node, val, to_attr = false
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest naming this in a more generic way, like encode_attribute_value from HTML5 converter. We also do not need to escape anything besides " because others are already escaped.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestions! Will try to implement them and add unit tests. Mine was a quick WIP hack copying code from asciidoctor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, we even already have a function for that: xml_sanitize does exactly what is needed.

slonopotamus added a commit to slonopotamus/asciidoctor-epub3 that referenced this pull request Jan 7, 2024
slonopotamus added a commit to slonopotamus/asciidoctor-epub3 that referenced this pull request Jan 7, 2024
@slonopotamus slonopotamus added this to the v1.6.0 milestone Jan 7, 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.

3 participants