/* eslint-disable @typescript-eslint/no-unused-vars */ import React from 'react'; import Page from '../Page'; import useToolkit from '../toolkit/useToolkit'; import anchorsMinimalConfig from './cards/anchorsMinimalConfig'; import anchorsBlockConfig from './cards/anchorsBlockConfig'; import anchorsCustomConfig from './cards/anchorsCustomConfig'; import anchorsRelativeConfig from './cards/anchorsRelativeConfig'; import InternalRendererAdmonition from '../components/InternalRendererAdmonition'; export default function PageContentAnchors() { const { Acronym, Admonition, Bold, Header, Paragraph, Chapter, SourceDisplay, RefLibrary, RefRNSymbol, RefHtmlElement, RefCssProperty, RefRenderHtmlProp, RefTRE, RefRenderHTMLExport, RefHtmlAttr, RefDoc, RenderHtmlCard, Section, InlineCode, Hyperlink, List, ListItem, SvgFigure } = useToolkit(); return (
By default, pressing an anchor will open the link in the system browser. This is done with React Native {' '} API. In the below example, the anchor will be translated to a{' '} node, because some of its children ( ) have a block content model. This is a feature of the mixed content model. The HTML standard allows relative URLs, for example when anchors have a href attribute with no origin, such as{' '} <a href="contact.html">. The new foundry release adheres closely to this standard, by extracting information about the baseUrl of the current page. Either by the mean of the {' '} element, or by information contained in the{' '} prop. Example: You can use the same URL normalization mechanism in your custom renderers thanks to {' '} hook. We can take advantage of the{' '} to customize anchors behavior (see{' '} ). Anchors support onPress prop to handle press events.
); }