Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Mobile] - Image corrector- Expand comment explaining the filtering f…
…or file: media paths
  • Loading branch information
Gerardo committed Jun 3, 2024
commit edd75ce65b7352c25708cc5253cabd88cb4fdc40
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export default function imageCorrector( node ) {
return;
}

// For local files makes sure the extension is a valid one, if not it removes the path.
// For local files makes sure the path doesn't end with an invalid extension.
// This scenario often happens with content from MS Word and similar text apps.
// We still need to support local files pasted from the users Media library.
if ( node.src.startsWith( 'file:' ) && node.src.slice( -1 ) === '/' ) {
node.setAttribute( 'src', '' );
}
Expand Down