{"record":{"id":"06f9c3e162966b8d","repo":"Shopify/liquid","slug":"errors-syntax-block-tag-unexpected-args","errorCode":"errors.syntax.block_tag_unexpected_args","errorMessage":"parse_context.locale.t(\"errors.syntax.block_tag_unexpected_args\", tag: tag_name)","messagePattern":"parse_context\\.locale\\.t\\(\"errors\\.syntax\\.block_tag_unexpected_args\", tag: tag_name\\)","errorType":"exception","errorClass":"Liquid::SyntaxError","httpStatus":null,"severity":"error","filePath":"lib/liquid/tags/doc.rb","lineNumber":73,"sourceCode":"    end\n\n    def render_to_output_buffer(_context, output)\n      output\n    end\n\n    def blank?\n      @body.empty?\n    end\n\n    def nodelist\n      [@body]\n    end\n\n    private\n\n    def ensure_valid_markup(tag_name, markup, parse_context)\n      unless NO_UNEXPECTED_ARGS.match?(markup)\n        raise SyntaxError, parse_context.locale.t(\"errors.syntax.block_tag_unexpected_args\", tag: tag_name)\n      end\n    end\n\n    def raise_nested_doc_error\n      raise SyntaxError, parse_context.locale.t(\"errors.syntax.doc_invalid_nested\")\n    end\n  end\nend\n","sourceCodeStart":55,"sourceCodeEnd":82,"githubUrl":"https://github.com/Shopify/liquid/blob/807d45a6b3d4568e64e86b375e3702df2c7c860c/lib/liquid/tags/doc.rb#L55-L82","documentation":"The `{% doc %}` block tag accepts no arguments. ensure_valid_markup, called from Doc#initialize, raises SyntaxError with the localized 'errors.syntax.block_tag_unexpected_args' (interpolating the tag name) when the markup does not match the NO_UNEXPECTED_ARGS pattern.","triggerScenarios":"Writing arguments on the opening doc tag, e.g. `{% doc description %} ... {% enddoc %}` or `{% doc name=\"x\" %}`.","commonSituations":"Authors trying to name documentation blocks; copying doc tag usage from other documentation systems that take a title argument; tooling injecting attributes into block tags.","solutions":["Remove all arguments: use bare {% doc %} ... {% enddoc %}","If you need to label the doc content, put the label on a comment line inside the block","Update any template generators that append attributes to block tags","Add a lint rule rejecting arguments on argument-less block tags"],"exampleFix":"// before\n{% doc description %}\n  Renders the price.\n{% enddoc %}\n// after\n{% doc %}\n  description: Renders the price.\n{% enddoc %}","handlingStrategy":"validation","validationCode":"def valid_doc_markup?(markup)\n  markup.strip.empty?\nend","typeGuard":null,"tryCatchPattern":"begin\n  Liquid::Template.parse(source)\nrescue Liquid::SyntaxError => e\n  raise \"doc tag takes no arguments: #{e.message}\"\nend","preventionTips":["Never add arguments to `{% doc %}`","Put labels inside the block content, not on the tag","Check generator tooling for injected tag attributes"],"tags":["liquid","ruby","template-syntax","doc-tag"],"backgroundTag":"liquid-tag-syntax-error","analyzedSha":"807d45a6b3d4568e64e86b375e3702df2c7c860c","analyzedAt":"2026-09-08T11:31:38.917Z","contentChangedAt":"2026-09-08T11:31:38.917Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}