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

Captions on images embedded in post content uneditable (admin) and not appearing (frontend). #27

Open
aseroff opened this issue Nov 2, 2021 · 0 comments

Comments

@aseroff
Copy link
Contributor

aseroff commented Nov 2, 2021

On versions 0.3.0 and at master@d813dae, I'm experiencing issues with images included in a post's content.

The first problem is that while composing a post in admin, for all embedded images after the first, it becomes impossible to click on the Alt Text placeholder text to set a caption for the images. I have noted that in a rich text field of a page in the Spina (non-blog) side of things, this is not an issue - a floating text field appears for all images that allows editing of the alt text value.

Next, for all images (including the first), the caption text does not appear as part of the rendering of @post.content.html_safe. While inspecting in browser, I can see

<figure data-trix-attachment="{&quot;content&quot;:&quot;<span class=\&quot;trix-attachment-spina-image\&quot; data-label=\&quot;CAPTION\&quot;>\n<img src=\&quot;http://localhost:3000/rails/active_storage/representations/...\&quot; alt=\&quot;CAPTION\&quot;>\n    </span>&quot;,&quot;contentType&quot;:&quot;Spina::Image&quot;}" data-trix-content-type="Spina::Image" class="attachment attachment--content">
  <span class="trix-attachment-spina-image" data-label="CAPTION">
      <img src="http://localhost:3000/rails/active_storage/representations/..." alt="CAPTION">
  </span>
  <figcaption class="attachment__caption"></figcaption>
</figure>

As you can see, the figcaption is empty, despite the alt text value ("CAPTION") being propagated throughout the figure. It seems odd for it not to be placed as the value for figcaption. This behavior is identical between spina_blog's posts and spina's pages, which leads me to believe that it may be a desired behavior that the text is alt text only and not meant to be a caption. If this is true, I believe this is a feature request. I'm in the process of replacing a wordpress with a spina implementation, and the inability for a content manager to be able to manipulate image placement and caption in a post is the only showstopper I've run into.

I've acquainted myself with an issue over at the Spina framework repo, where alt tags were extended into the trix implementation, perhaps making them a caption as well can be considered? Over in that thread I also see a gif for image placement, which would be welcome as well, however I don't experience that behavior.

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

No branches or pull requests

1 participant