theodinproject icon indicating copy to clipboard operation
theodinproject copied to clipboard

Bug: Share btn improperly working in Preview Tool on click

Open Monatric opened this issue 7 months ago • 1 comments

Checks

  • [x] I have thoroughly read and understand The Odin Project Contributing Guide
  • [x] The title of this issue follows the Bug: brief description of bug format, e.g. Bug: Lesson complete button does not update on click
  • [ ] Would you like to work on this issue?

Bug description

In the markdown preview tool, the share button works normally on simple texts where it would show the share preview link when the button is clicked. But when pasting the content from the given assignment, the share preview link does not appear anymore.

The source of the pasted content is in the given assignment, fourth item, in Ruby - Files and Serialization lesson. From there, it is advised to copy the contents from the pastebin, and paste it in the markdown preview tool.

How to reproduce

  1. Visit the markdown preview tool.
  2. Copy the contents of the pastebin, provided by the assignment.
  3. Click the share button. It doesn't matter whether you are on the Write or Preview tab.
  4. The share preview link does not appear.

Expected behavior

  1. Visit the markdown preview tool.
  2. Copy the contents of the pastebin, provided by the assignment.
  3. Click the share button. It doesn't matter whether you are on the Write or Preview tab.
  4. The share preview link should appear.

What browsers are you seeing the problem on?

Chrome, Firefox, Other, Microsoft Edge

What OS are you using?

Windows, Ubuntu

Discord Name

Koko

Additional Comments

No response

Monatric avatar May 11 '25 13:05 Monatric

Thanks for reporting @Monatric, I wasn't aware we were using the preview tool for that. The preview tool is only designed to work with our lesson markdown, I think we should probably swap out that resource or remove it instead making learners jump through hoops with pastebin and the markdown preview workaround.

But there is a bug here, our CDN is blocking the share button when there's code in the payload - it thinks it's an injection attack. I'll look into this one.

KevinMulhern avatar May 11 '25 16:05 KevinMulhern

This should be fixed now 👍

KevinMulhern avatar Jul 04 '25 10:07 KevinMulhern