emmetio / xml-diff

Diff and patch contents of XML documents
MIT License
3 stars 1 forks source link

diff function options details #10

Closed eurlexa closed 2 weeks ago

eurlexa commented 2 weeks ago

Hi,

first of all big thank you for this great and super fast library. Compared to others it returs nice clean tags in a result.

Just one question .I can see there is a third parameter in diff function

export default function diff(from: ParsedModel, to: ParsedModel, options: Options = createOptions())

and then

const defaultOptions: Partial<Options> = {
    compact: true,
    normalizeSpace: true,
    allTokens: true,
    baseStart: 0,
    replaceThreshold: 0,
    // preserveTags: [],
    preserveXml: true,
    inlineElements: [
        'a', 'abbr', 'acronym', 'applet', 'b', 'basefont', 'bdo',
        'big', 'br', 'button', 'cite', 'code', 'del', 'dfn', 'em', 'font', 'i',
        'iframe', 'img', 'input', 'ins', 'kbd', 'label', 'map', 'object', 'q',
        's', 'samp', 'select', 'small', 'span', 'strike', 'strong', 'sub', 'sup',
        'textarea', 'tt', 'u', 'var'
    ]
};

Is there any documentatin available describing these options?

Thank yyou very much.

sergeche commented 2 weeks ago

Hi, all options are described here: https://github.com/emmetio/xml-diff/blob/master/src/options.ts#L53

Some of the options are for xml parsing and described here: https://github.com/emmetio/html-matcher/blob/master/src/utils.ts#L54

eurlexa commented 2 weeks ago

Great, thank you very much.