@Bastien Dumont I did not know about the native format. It does make a lot more sense to compare the AST than a particular format which as you have said is subject to change. Cheers On Wednesday, January 26, 2022 at 5:45:43 PM UTC+5:30 Bastien Dumont wrote: > Alternatively, you can export to native for testing purposes. It preserves > the raw OOXML code added by your filter, if any, and will make your test > files independant of potential changes in Pandoc writers. > > Le Wednesday 26 January 2022 à 02:49:34AM, Nandakumar Chandrasekhar a > écrit : > > Thanks for the explanation William, I now understand. > > > > After further research, I found the way you suggested by converting the > > generated files back to markdown and then doing a diff on those. > > > > Thank you for confirming this methodology. > > > > Cheers. > > > > On Wednesday, January 26, 2022 at 3:20:10 PM UTC+5:30 William Lupton > wrote: > > > > Just commenting on this: > > > > > The two file always differ when I try: diff expected.docx sample.docx. > I > > do not see why they should differ when they were created with the same > > parameters and source file with only the name changing. > > > > A docx file is a ZIP that contains many resources including a file > > called docProps/core.xml that includes "created" and "modified" > properties > > that indicate when the document was created and modified. > > > > Therefore I don't think that you can assume that two docx files with > > identical content are in fact identical. > > > > Perhaps the word/document.xml files (also in the ZIP) will be identical, > or > > perhaps it would be better to convert to a different format for > comparison > > purposes? > > > > William > > > > On Wed, 26 Jan 2022 at 09:40, Nandakumar Chandrasekhar < > > navani...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Dear Folks, > > > > I am in the process of writing a lua-filter that modifies the font of > > font-awesome icons added to a Word/DOCX document. > > > > I am finding that if I were to generate a file called expected.docx > > from the code: > > > > pandoc -f markdown -t docx --reference-doc sample-reference.docx -o > > expected.docx sample.md > > > > and then generate another docx file with a different name using the > > same source file and reference docx as below: > > > > pandoc -f markdown -t docx --reference-doc sample-reference.docx -o > > sample.docx sample.md > > > > The two file always differ when I try: > > > > diff expected.docx sample.docx > > > > I do not see why they should differ when they were created with the > > same parameters and source file with only the name changing. > > > > What alternatives do I have to stop making the files differ. > > > > I need to write tests for my lua filter to be accepted into pandoc/ > > lua-filters. > > > > Therefore, I need to make sure that the expected output and the > > generated output are exactly the same to pass the test. > > > > I hope someone can lend some insight. > > > > Many thanks. > > > > -- > > You received this message because you are subscribed to the Google > > Groups "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > > an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [1]https://groups.google.com/d > > /msgid/pandoc-discuss/ > > a3d1fad4-91f6-4495-aa4c-874f6ca5bb6en%40googlegroups.com. > > > > -- > > You received this message because you are subscribed to the Google Groups > > "pandoc-discuss" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email > > to [2]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To view this discussion on the web visit [3] > https://groups.google.com/d/msgid/ > > pandoc-discuss/b8ce8324-2f09-4448-a38a-702e2a0ea3e7n%40googlegroups.com. > > > > References: > > > > [1] > https://groups.google.com/d/msgid/pandoc-discuss/a3d1fad4-91f6-4495-aa4c-874f6ca5bb6en%40googlegroups.com?utm_medium=email&utm_source=footer > > [2] mailto:pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > > [3] > https://groups.google.com/d/msgid/pandoc-discuss/b8ce8324-2f09-4448-a38a-702e2a0ea3e7n%40googlegroups.com?utm_medium=email&utm_source=footer > > -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/176295a0-ed8d-4953-a852-792f9481e648n%40googlegroups.com.