{"record":{"id":"146c64f5069e1cfe","repo":"typst/typst","slug":"content-labelled-multiple-times","errorCode":null,"errorMessage":"content labelled multiple times","messagePattern":"content labelled multiple times","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-eval/src/markup.rs","lineNumber":58,"sourceCode":"\n                seq.push(eval_markup(vm, exprs)?.styled_with_map(styles));\n            }\n            ast::Expr::ShowRule(show) => {\n                let recipe = show.eval(vm)?;\n                if vm.flow.is_some() {\n                    break;\n                }\n\n                let tail = eval_markup(vm, exprs)?;\n                seq.push(tail.styled_with_recipe(&mut vm.engine, vm.context, recipe)?);\n            }\n            expr => match expr.eval(vm)? {\n                Value::Label(label) => {\n                    if let Some(elem) =\n                        seq.iter_mut().rev().find(|node| !node.can::<dyn Unlabellable>())\n                    {\n                        if elem.label().is_some() {\n                            vm.engine.sink.warn(warning!(\n                                elem.span(), \"content labelled multiple times\";\n                                hint: \"only the last label is used, the rest are ignored\";\n                            ));\n                        }\n\n                        *elem = std::mem::take(elem).labelled(label);\n                    } else {\n                        vm.engine.sink.warn(warning!(\n                            expr.span(),\n                            \"label `{}` is not attached to anything\",\n                            label.repr(),\n                        ));\n                    }\n                }\n                value => seq.push(value.display().spanned(expr.span())),\n            },\n        }\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-eval/src/markup.rs#L40-L76","documentation":"Warning in eval_markup: a label expression attaches to preceding content, but the nearest labellable element already has a label, so the new label would overwrite (or duplicate) an existing one. Multiple labels on the same element are not meaningful.","triggerScenarios":"Thrown at crates/typst-eval/src/markup.rs:58 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicate label","Move one of the labels so each labels a distinct element","Wrap the element in another container if both labels are genuinely needed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}