Skip to content

Local Environment: Inline images are broken when site starts on a different port #14

Open

Description

@adamziel

Test:

  1. Start wp-now
  2. Create a post, upload an image, save the post
  3. Display the post
  4. Close wp-now, start on a different port
  5. Confirm the image is still correctly displayed

cc @sejas @danielbachhuber

Activity

  1. changed the title [-]Local env test: Reusable content[/-] [+]Local Environment: Inline images are broken when site starts on a different port[/+] on May 16, 2023
  2. danielbachhuber commented on May 16, 2023

    @danielbachhuber
    Member

    5. Confirm the image is still correctly displayed

    The image is broken:

    image

    The underlying problem is that WordPress stores absolute URLs in the post_content:

    <!-- wp:image {"id":6,"sizeSlug":"full","linkDestination":"none"} -->
    <figure class="wp-block-image size-full"><img src="http://127.0.0.1:8881/wp-content/uploads/2023/05/28662c0097a9d8029.05331394.jpg" alt="" class="wp-image-6"/></figure>
    <!-- /wp:image -->
    

    I'm not sure of a great fix for this. #22 is one potential path forward. Some on-the-fly search-replace could be another option, but that's probably a can of worms.

    I captured it as a known issue: #14

  3. ironnysh commented on May 1, 2024

    @ironnysh
    Contributor

    That seems to be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions