Feature suggestions and discussion [READ THE FIRST POST]

.
Lightning Dust - For supporting the site
Amethyst Star - For supporting the site
Best Artist - Providing quality, Derpibooru-exclusive artwork
Cutest Little Devil - Celebrated the 14th anniversary of MLP:FIM!
Ruby - For users who have donated to the site
Emerald - For users who have donated to the site
Rainbow Rocks 10th Anniversary: Adagio Dazzle - Celebrated the 10th anniversary of EQG Rainbow Rocks!
Artist -
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Magnificent Metadata Maniac - #1 Assistant

How about a change like
--- a/lib/philomena/versions.ex
+++ b/lib/philomena/versions.ex
@@ -48,7 +48,16 @@ defmodule Philomena.Versions do
   end
 
   defp difference(previous, nil), do: [eq: previous]
-  defp difference(previous, next), do: String.myers_difference(previous, next)
+  defp difference(previous, next) do
+    List.myers_difference(String.split(previous), String.split(next))
+    |> Enum.map(fn {key, value} ->
+      adjust_whitespace({key, Enum.reduce(value, "", fn new, old ->
+        old <> " " <> new
+      end)})
+    end)
+  end
+  defp adjust_whitespace({:eq, str}), do: {:eq, " " <> str <> " "}
+  defp adjust_whitespace({op, str}), do: {op, String.trim(str)}
 
   @doc """
   Creates a version.
to turn gibberish like
into something readable
It’s certainly possible to pretty up the code a bit, but the comment history looks way nicer that way.
byte[]
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Non-Fungible Trixie -
Verified Pegasus - Show us your gorgeous wings!
Preenhub - We all know what you were up to this evening~
An Artist Who Rocks - 100+ images under their artist tag
Artist -

Philomena Contributor
@.
I would suggest going even further and hiding lines that have not changed, but yeah, this is a good change
Background Pony #2A5F
@.
+1 for word-wise diffs.
@byte[]
Unchanged lines provide context. Diffs without context are harder to understand. Git diffs default to 3 lines of context for a reason. Hiding only unchanged lines that fall outside of context would make more sense, but is it worth the added logic?
byte[]
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Non-Fungible Trixie -
Verified Pegasus - Show us your gorgeous wings!
Preenhub - We all know what you were up to this evening~
An Artist Who Rocks - 100+ images under their artist tag
Artist -

Philomena Contributor
@.
I think the solution that is needed is more like List.myers_difference/3 on lists of lines, and then use the callback parameter to handle the word differences within lines.
.
Lightning Dust - For supporting the site
Amethyst Star - For supporting the site
Best Artist - Providing quality, Derpibooru-exclusive artwork
Cutest Little Devil - Celebrated the 14th anniversary of MLP:FIM!
Ruby - For users who have donated to the site
Emerald - For users who have donated to the site
Rainbow Rocks 10th Anniversary: Adagio Dazzle - Celebrated the 10th anniversary of EQG Rainbow Rocks!
Artist -
Nightmare in the Moon - Had their OC in the 2024 Derpibooru Collab.
Magnificent Metadata Maniac - #1 Assistant

@byte[]
Or how about this:
--- a/lib/philomena/versions.ex
+++ b/lib/philomena/versions.ex
@@ -48,7 +48,14 @@ defmodule Philomena.Versions do
   end
 
   defp difference(previous, nil), do: [eq: previous]
-  defp difference(previous, next), do: String.myers_difference(previous, next)
+  defp difference(previous, next) do
+    List.myers_difference(split_with_whitespace(previous), split_with_whitespace(next))
+    |> Enum.map(
+      fn {key, value} ->
+        {key, List.foldl(value, "", fn x, acc -> acc <> x end)}
+      end)
+  end
+  defp split_with_whitespace(str), do: String.split(str, ~r{\s+}, include_captures: true)
 
   @doc """
   Creates a version.
This properly preserves newlines and such. I don’t think it matters when lines without changes are also included. Most posts don’t contain several pages worth of text and having context is indeed a good thing.
Background Pony #965A
@Background Pony #2A5F
Imo, git includes 3 lines of context because of traditional 80~140 symbols line limit, while natural plain texts may have lines of any size (aka paragraphs). So context from the changed paragraph alone usually should be enough.
Background Pony #0F89
@., @byte[], @Background Pony #2A5F
While we’re talking about this, the edit history page ought to also let you see the state of the post (or at least its code) at each state, without the diffs inserted, for easier readability - I have this inelegantly implemented in a userstyle that hides added text and unstyles removed text when I hover the block…
Luna
Luna - For Patreon supporters
Woona - Derpi Supporter
PonyCon Holland -
Pixel Perfection - I still call her Lightning Bolt
Flower Trio - Helped others get their OC into the 2023 Derpibooru Collab.
Roseluck - Had their OC in the 2023 Derpibooru Collab.
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Princess of Love - Extra special version for those who participated in the Canterlot Wedding 10th anniversary event by contributing art.
Tree of Harmony - Drew someone's OC for the 2022 Community Collab

Luna Best Pony~
@.
I’m working on a bit of a different version of this that does not display the whole post, and works on the basis of lines, not words (although I’ll highlight difference in words between lines too, this is just a prototype).
Bee movie script example:
new
old
Background Pony #2A5F
@Luna
Not sure if line-wise diffs are optimal for this. Lines of regular text are longer than lines of code. Typically, a paragraph will be one line.
Posted Report
Luna
Luna - For Patreon supporters
Woona - Derpi Supporter
PonyCon Holland -
Pixel Perfection - I still call her Lightning Bolt
Flower Trio - Helped others get their OC into the 2023 Derpibooru Collab.
Roseluck - Had their OC in the 2023 Derpibooru Collab.
Solar Supporter - Fought against the New Lunar Republic rebellion on the side of the Solar Deity (April Fools 2023).
Lunar Supporter - Helped forge New Lunar Republic's freedom in the face of the Solar Empire's oppressive tyrannical regime (April Fools 2023).
Princess of Love - Extra special version for those who participated in the Canterlot Wedding 10th anniversary event by contributing art.
Tree of Harmony - Drew someone's OC for the 2022 Community Collab

Luna Best Pony~
@Background Pony #2A5F
They will also highlight differences in precise words. This diff is meant to be such that in extremely large posts or pages, where only 1 word changes, it’s possible to display just the snippet that changed with some context around it.
Posted Report
Interested in advertising on Derpibooru? Click here for information!
Techy Cutie Pony Collection!

Help fund the $15 daily operational cost of Derpibooru - support us financially!

Syntax quick reference: **bold** *italic* ||hide text|| `code` __underline__ ~~strike~~ ^sup^ ~sub~

Detailed syntax guide