{"record":{"id":"139ab08e3c50016d","repo":"forem/forem","slug":"github-tag-invalid-options-invalid-supporte","errorCode":null,"errorMessage":"GitHub tag: invalid options: %{invalid} | supported options: %{valid}","messagePattern":"GitHub tag: invalid options: %(.+?) \\| supported options: %(.+?)","errorType":"exception","errorClass":"StandardError","httpStatus":null,"severity":"error","filePath":"app/liquid_tags/github_tag/github_readme_tag.rb","lineNumber":55,"sourceCode":"\n      path, *options = sanitized_input.split\n\n      validate_options!(*options)\n\n      path.delete_suffix!(\"/\") # remove optional trailing forward slash\n      repository_path = Addressable::URI.parse(path)\n      repository_path.query = repository_path.fragment = nil\n\n      [repository_path.normalize.to_s, options]\n    end\n\n    def validate_options!(*options)\n      return if options.empty?\n      return if options.all? { |o| NOREADME_OPTIONS.include?(o) }\n\n      message = I18n.t(\"liquid_tags.github_tag.github_readme_tag.invalid_options\",\n                       invalid: (options - NOREADME_OPTIONS), valid: NOREADME_OPTIONS)\n      raise StandardError, message\n    end\n\n    def show_readme?\n      options.none?\n    end\n\n    def fetch_readme(repository_path, repository_url)\n      readme_html = Github::OauthClient.new.readme(repository_path, accept: \"application/vnd.github.html\")\n      clean_relative_path!(readme_html, repository_url)\n    rescue Github::Errors::NotFound\n      nil\n    end\n\n    def sanitize_input(input)\n      ActionController::Base.helpers.strip_tags(input)\n        .gsub(GITHUB_DOMAIN_REGEXP, \"\")\n        .strip\n    end","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/forem/forem/blob/f354c376a7c5d1330dc40d66f150be8d1289020d/app/liquid_tags/github_tag/github_readme_tag.rb#L37-L73","documentation":"{% github <owner>/<repo> [option] %} renders a repository card, optionally without its README. validate_options! accepts an empty option list or options drawn entirely from NOREADME_OPTIONS = %w[no-readme noreadme]; any other token (or a mix that includes one) raises with the invalid tokens and the valid list interpolated into the message.","triggerScenarios":"{% github user/repo no_readme %} (underscore instead of hyphen); {% github user/repo hide-readme %}; {% github user/repo noreadme extra %} (valid option mixed with an unknown one fails the .all? check); duplicated tokens like noreadme noreadme are fine since both are whitelisted.","commonSituations":"Author guesses the flag spelling from another tag's vocabulary (underscore vs hyphen vs the two accepted spellings); a doc example from an older revision used a different flag; extra text accidentally left after the option.","solutions":["Use exactly no-readme or noreadme: {% github user/repo noreadme %}.","Pass no option at all to render the repository card with its README.","Remove any extra tokens after the path — everything after the first space is treated as options."],"exampleFix":"// before\n{% github forem/forem no_readme %}\n// after\n{% github forem/forem noreadme %}","handlingStrategy":"validation","validationCode":"path, *options = input.gsub(%r{.*github\\.com/}, '').split\nvalid = options.empty? || options.all? { |o| %w[no-readme noreadme].include?(o) }","typeGuard":"def github_readme_options_valid?(input)\n  _path, *options = input.gsub(%r{.*github\\.com/}, '').split\n  options.empty? || options.all? { |o| GithubTag::GithubReadmeTag::NOREADME_OPTIONS.include?(o) }\nend","tryCatchPattern":"begin\n  GithubTag::GithubReadmeTag.new(input)\nrescue StandardError => e\n  errors << e.message\nend","preventionTips":["Offer the two flags (no-readme, noreadme) from a dropdown rather than free text.","Trim stray tokens after the repo path — they are parsed as options.","Reference NOREADME_OPTIONS in docs so the vocabulary stays in sync."],"tags":["liquid","forem","github-tag","validation","options"],"backgroundTag":"unsupported-option","analyzedSha":"f354c376a7c5d1330dc40d66f150be8d1289020d","analyzedAt":"2026-08-21T12:43:44.428Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}