diff --git a/publicodes/source/components/RuleLink.tsx b/publicodes/source/components/RuleLink.tsx index 60fbe82fa..0db69bcd6 100644 --- a/publicodes/source/components/RuleLink.tsx +++ b/publicodes/source/components/RuleLink.tsx @@ -2,6 +2,7 @@ import React, { useContext } from 'react' import emoji from 'react-easy-emoji' import { Link } from 'react-router-dom' import Engine from '..' +import { InternalError } from '../error' import { encodeRuleName, nameLeaf } from '../ruleUtils' import { BasepathContext, EngineContext } from './contexts' @@ -41,18 +42,19 @@ export function RuleLink({ // if (!ruleWithDedicatedDocumentationPage(rule)) { // return // } - if (rule) { - return ( - - {children || rule.title}{' '} - {displayIcon && rule.rawNode.icônes && ( - {emoji(rule.rawNode.icônes)} - )} - - ) - } else { - return <>{nameLeaf(dottedName)} + if (!rule) { + throw new InternalError({ + dottedName, + }) } + return ( + + {children || rule.title}{' '} + {displayIcon && rule.rawNode.icônes && ( + {emoji(rule.rawNode.icônes)} + )} + + ) } export function RuleLinkWithContext( diff --git a/publicodes/source/components/rule/RulePage.tsx b/publicodes/source/components/rule/RulePage.tsx index be89e452d..2ef6f01cd 100644 --- a/publicodes/source/components/rule/RulePage.tsx +++ b/publicodes/source/components/rule/RulePage.tsx @@ -55,10 +55,7 @@ export default function Rule({ dottedName, engine, language }) { <>

Parent non applicable

- Cette règle est non applicable car{' '} - {' '} + Cette règle est non applicable car est non applicable.