mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 21:45:43 +01:00
Create api for markdown ast plugins (#1578)
Currently we only have the option to adjust rendering of the markdown output, but no option to change the generated ast tree before rendering takes place (i.e. to adjust the structure like when replacing text with links). This PR adds a new api to create ast plugins that can be integrated with the markdown view component. This is intended to be backwards-compatible and work independently from the underlying implementation. Co-authored-by: Sebastian Sdorra <sebastian.sdorra@cloudogu.com>
This commit is contained in:
committed by
GitHub
parent
0d3339b0cb
commit
e66553705f
@@ -39,9 +39,10 @@ const queryClient = new QueryClient({
|
||||
type Props = LegacyContext & {
|
||||
index?: IndexResources;
|
||||
me?: Me;
|
||||
devtools?: boolean;
|
||||
};
|
||||
|
||||
const ApiProvider: FC<Props> = ({ children, index, me, onMeFetched, onIndexFetched }) => {
|
||||
const ApiProvider: FC<Props> = ({ children, index, me, onMeFetched, onIndexFetched, devtools = true }) => {
|
||||
useEffect(() => {
|
||||
if (index) {
|
||||
queryClient.setQueryData("index", index);
|
||||
@@ -63,7 +64,7 @@ const ApiProvider: FC<Props> = ({ children, index, me, onMeFetched, onIndexFetch
|
||||
<LegacyContextProvider onIndexFetched={onIndexFetched} onMeFetched={onMeFetched}>
|
||||
{children}
|
||||
</LegacyContextProvider>
|
||||
<ReactQueryDevtools initialIsOpen={false} />
|
||||
{devtools ? <ReactQueryDevtools initialIsOpen={false} /> : null}
|
||||
</QueryClientProvider>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user