Skip to content

Conversation

@etobella
Copy link
Member

Shows differences by markdown:

image

@pedrobaeza
Copy link
Member

And what happens with HTML?

@etobella
Copy link
Member Author

The proble with diff made with HTML is that is usually less clear to final users. It includes a lot of changes, that are not clear for them. Markdown is clear for them. In any case, with the current change, the mardown difference is only accessible if you have defined it (we could even do a parameter for this in order to make it cleaner and keep HTML by default).

@pedrobaeza pedrobaeza added this to the 18.0 milestone Oct 28, 2025
@pedrobaeza
Copy link
Member

Yeah, what I mean is that right now, there's no HTML diff, but plain text over HTML code diff, so what I'm talking about is to render the HTML and the marks of diff.

@etobella
Copy link
Member Author

I am not sure if that is factible... for example Github is not doing that with html files It shows the diff of lines.

@pedrobaeza
Copy link
Member

Well, but that's because it's mostly code, but here we have documentation in rich text format, so I think it's a different beast, and we should provide proper tools for it.

Copy link
Contributor

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally and LGTM!

@etobella
Copy link
Member Author

@pedrobaeza There is something like: https://pypi.org/project/html-diff/. What do you think?

@pedrobaeza
Copy link
Member

Yeah, it seems interesting.

@etobella
Copy link
Member Author

@pedrobaeza Something like this?

image

@pedrobaeza
Copy link
Member

Yeah, it looks great!!

@etobella etobella changed the title [IMP] document_page: Allow to show diffs using markdown [IMP] document_page: Allow to show diffs using another library. Dec 15, 2025
@etobella etobella force-pushed the 18.0-markdown branch 2 times, most recently from 233255d to e920170 Compare December 15, 2025 09:18
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!! for sure is better than it is now... I got very used to ignore the diff because it was unusable...

Copy link
Contributor

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested locally after recent changes and it works fine. Good job!

@pedrobaeza pedrobaeza changed the title [IMP] document_page: Allow to show diffs using another library. [18.0][IMP] document_page: Allow to show diffs using another library. Dec 17, 2025
Copy link
Contributor

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detected something weird. After deleting one line, the whole document is crossed out and detected as new.

Grabacion.de.pantalla.desde.2025-12-17.08-11-43.mp4

@etobella
Copy link
Member Author

@luisDIXMIT I found the same at some point, but I think this is a consequence of the import of the demo data.

Can you try with a document created by you directly?

@luisDIXMIT
Copy link
Contributor

@luisDIXMIT I found the same at some point, but I think this is a consequence of the import of the demo data.

Can you try with a document created by you directly?

I created a new test document with one line. After saving it, I added another line, and this is how it was detected:

image

@etobella etobella force-pushed the 18.0-markdown branch 2 times, most recently from f5f8494 to 7e86662 Compare December 17, 2025 08:43
@etobella
Copy link
Member Author

I found the problem and a much better solution.

Odoo provides a diff method, so we can do everything without external libraries.

@etobella etobella changed the title [18.0][IMP] document_page: Allow to show diffs using another library. [18.0][IMP] document_page: Use odoo standard diff tool for showing the real difference Dec 17, 2025
@etobella
Copy link
Member Author

I think it is much cleaner now:

image

@pedrobaeza WDYT?

It can be ported automatically to v17, but on 16 we might need to add some code from odoo on it

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Contributor

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with the latest changes and LGTM!

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great improvement.

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-563-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 60b3cec into OCA:18.0 Dec 17, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 6305191. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants