Type: Function

How to get configureAsInlineImage?


import configureAsInlineImage from 'fontoxml-families/src/configureAsInlineImage.js'

Like an image, but inline.

The image is shown within the text of its parent and vertically resized to one line height. The width is scaled.

Images can be deleted by pressing Backspace or Delete twice: the first press selects the image to help the author understand what will happen.

Used for inline elements that represent images. These images may be represented by a permanent id or a non-permanent id. By setting the option options.isPermanentId to true, the result of the query is interpreted as a permanent id, which will be resolved.

The optionsOrReferenceAttributeName parameter can be both the name of the attribute containing the permanent id, or the options object. This options object may then contain an XPath query resolving to the reference (either permanent or relative) which points to the image.

For backwards compatibility, the fourth argument to this function may be the name of an attribute. If the attribute name is passed as the fourth parameter, the image is assumed to use permanent ids. This is deprecated, using an options object as the fourth argument is preferred.

The following widget areas are available:

  • inlineBefore

  • inlineAfter

This family has a number of additional options which affect how it behaves:

  • referenceQuery

  • isPermanentId


// Configure HTML images without permanent ids
configureAsInlineImage(sxModule, 'self::img', 'image', { referenceQuery: '@src', isPermanentId: false });

// Configure HTML images with permanent ids
configureAsInlineImage(sxModule, 'self::img', 'image', { referenceQuery: '@src', isPermanentId: true });

// Configure an other kind of image with the url as its text content
configureAsInlineImage(sxModule, 'self::img', 'image', { referenceQuery: 'string(.)', isPermanentId: true });

// Configure HTML images using the deprecated syntax. This forces permanent ids
configureAsInlineImage(sxModule, 'self::img', 'image', 'src');


  1. sxModule


    Type: SxModule

  2. selector


    Type: XPathTest

  3. markupLabel


    Type: String

  4. options


    The options, or the name of the attribute in which the permanent id referencing this image is located. The generic CvkOptions are expanded with two properties:


  5. oldOptionsParameter