{"product_id":"fell_the_profane_-_fell_mire_mh3_244","title":"Fell the Profane \/\/ Fell Mire","description":"\u003cdiv style=\"display: none;\"\u003e\n```python\nimport re\nimport json\n\ndef transform_json_to_html(front_card_data_json, back_card_data_json):\n    front_card_data = json.loads(front_card_data_json)\n    back_card_data = json.loads(back_card_data_json) if back_card_data_json else None\n\n    # Icon replacement mapping\n    symbol_map = {\n        \"{W}\": \"White\", \"{U}\": \"Blue\", \"{B}\": \"Black\", \"{R}\": \"Red\", \"{G}\": \"Green\",\n        \"{C}\": \"Colorless\", \"{X}\": \"X\", \"{Y}\": \"Y\", \"{Z}\": \"Z\",\n        \"{W\/P}\": \"White-Phyrexian\", \"{U\/P}\": \"Blue-Phyrexian\", \"{B\/P}\": \"Black-Phyrexian\",\n        \"{R\/P}\": \"Red-Phyrexian\", \"{G\/P}\": \"Green-Phyrexian\",\n        \"{W\/U}\": \"White-Blue\", \"{W\/B}\": \"White-Black\", \"{U\/B}\": \"Blue-Black\",\n        \"{U\/R}\": \"Blue-Red\", \"{B\/R}\": \"Black-Red\", \"{B\/G}\": \"Black-Green\",\n        \"{R\/G}\": \"Red-Green\", \"{R\/W}\": \"Red-White\", \"{G\/W}\": \"Green-White\",\n        \"{G\/U}\": \"Green-Blue\",\n        \"{2\/W}\": \"2-White\", \"{2\/U}\": \"2-Blue\", \"{2\/B}\": \"2-Black\",\n        \"{2\/R}\": \"2-Red\", \"{2\/G}\": \"2-Green\",\n        \"{T}\": \"Tap\", \"{Q}\": \"Untap\", \"{S}\": \"Snow\", \"{E}\": \"Energy\"\n    }\n\n    def replace_symbols(text):\n        if not text:\n            return \"\"\n        \n        def replacer(match):\n            symbol_key = match.group(0)\n            \n            # Check for numeric symbols (e.g., {0}, {1}, {15})\n            stripped_symbol = symbol_key.strip('{}')\n            if stripped_symbol.isdigit():\n                symbol_name = stripped_symbol\n            else:\n                symbol_name = symbol_map.get(symbol_key, stripped_symbol) # Fallback to text without braces\n\n            return f'\u003cspan aria-label=\"{symbol_name}\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-{symbol_name}\"\u003e\u003c\/i\u003e\u003c\/span\u003e'\n\n        # Regex to find all mana\/ability symbols like {G}, {T}, {2}, {X}, {W\/P}, etc.\n        # It's important to match the longest possible symbol first, but re.sub handles this with specific keys\n        # The pattern covers digits, letters, '\/', 'X', 'S', 'Y', 'Z', 'E'\n        return re.sub(r'\\{([0-9a-zA-Z\\\/XSYZE]+?)\\}', replacer, text)\n\n    def process_single_face(face_details, main_card_details):\n        set_name = main_card_details.get('set_name', '')\n        set_name_url = set_name.replace(' ', '+')\n        \n        type_line = face_details.get('type_line', '')\n        mana_cost = face_details.get('mana_cost')\n        oracle_text = face_details.get('oracle_text', '')\n        flavor_text = face_details.get('flavor_text')\n        \n        # Determine Color from card_identity of the main card\n        color_identity = main_card_details.get('color_identity', [])\n        card_colors_text = []\n        color_name_map = {\n            \"W\": \"White\", \"U\": \"Blue\", \"B\": \"Black\", \"R\": \"Red\", \"G\": \"Green\"\n        }\n        \n        if not color_identity:\n            card_colors_text.append(\"Colorless\")\n        elif len(color_identity) \u0026gt; 1:\n            card_colors_text.append(\"Multicolor\")\n        else:\n            card_colors_text.append(color_name_map.get(color_identity[0], \"Colorless\"))\n\n        # Convert card_colors_text to URL format\n        card_colors_url = [c.replace(' ', '+') for c in card_colors_text]\n        \n        # Process mana cost\n        processed_mana_cost = replace_symbols(mana_cost) if mana_cost else \"\"\n\n        # Process oracle text\n        processed_oracle_text = oracle_text.replace('\\n', '\u003cbr\u003e')\n        processed_oracle_text = replace_symbols(processed_oracle_text)\n\n        # Construct the HTML for this face\n        html_parts = []\n        \n        # First \u003cp\u003e block\n        first_p_elements = [\n            f'\u003cstrong\u003eSet:\u003c\/strong\u003e \u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_card_expansion={set_name_url}\u0026amp;sort_by=best-selling\"\u003e{set_name}\u003c\/a\u003e\u003cbr\u003e',\n            f'\u003cstrong\u003eType:\u003c\/strong\u003e {type_line}\u003cbr\u003e'\n        ]\n        if mana_cost is not None and mana_cost.strip() != \"\":\n            first_p_elements.append(f'\u003cstrong\u003eCost:\u003c\/strong\u003e {processed_mana_cost}\u003cbr\u003e')\n        \n        color_links = []\n        for i, color_text in enumerate(card_colors_text):\n            color_link = f'\u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_mana_type={card_colors_url[i]}\u0026amp;sort_by=best-selling\"\u003e{color_text}\u003c\/a\u003e'\n            color_links.append(color_link)\n        \n        first_p_elements.append(f'\u003cstrong\u003eColor:\u003c\/strong\u003e {\",\".join(color_links)}')\n        html_parts.append(f'\u003c\/p\u003e\n\u003cp\u003e{\"\".join(first_p_elements)}\u003c\/p\u003e')\n\n        # Second \u003cp\u003e block (abilities)\n        if processed_oracle_text.strip() != \"\":\n            html_parts.append(f'\u003c\/p\u003e\n\u003cp\u003e{processed_oracle_text}\u003c\/p\u003e')\n        \n        # Third \u003cp\u003e block (flavor text)\n        if flavor_text:\n            html_parts.append(f'\u003c\/p\u003e\n\u003cp\u003e{flavor_text.replace(\"\\\\n\", \"\u003cbr\u003e\")}\u003c\/p\u003e')\n            \n        return \"\".join(html_parts), face_details.get('name', '')\n\n    final_output_html = []\n\n    if back_card_data: # Double-Faced Card\n        # Process Front Face\n        front_face_details = front_card_data['card_faces'][0]\n        front_face_html, front_face_name = process_single_face(front_face_details, front_card_data)\n        final_output_html.append(f\"\u003ch3\u003e{front_face_name}\u003c\/h3\u003e{front_face_html}\")\n        \n        # Process Back Face\n        back_face_details = back_card_data['card_faces'][1]\n        back_face_html, back_face_name = process_single_face(back_face_details, back_card_data)\n        final_output_html.append(f\"\u003chr\u003e\n\u003ch3\u003e{back_face_name}\u003c\/h3\u003e{back_face_html}\")\n    else: # Single-Faced Card\n        if 'card_faces' in front_card_data and front_card_data['card_faces']:\n            # This handles modal DFCs that might be passed as a single input for the front face\n            face_html, _ = process_single_face(front_card_data['card_faces'][0], front_card_data)\n            final_output_html.append(face_html)\n        else:\n            # Standard single-faced card\n            face_html, _ = process_single_face(front_card_data, front_card_data)\n            final_output_html.append(face_html)\n\n    return \"\".join(final_output_html)\n\n```\n\u003c\/div\u003e\u003ch3\u003eFell the Profane\u003c\/h3\u003e\u003cp\u003e\u003cstrong\u003eSet:\u003c\/strong\u003e \u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_card_expansion=Modern+Horizons+3\u0026amp;sort_by=best-selling\"\u003eModern Horizons 3\u003c\/a\u003e\u003cbr\u003e\u003cstrong\u003eType:\u003c\/strong\u003e Instant\u003cbr\u003e\u003cstrong\u003eCost:\u003c\/strong\u003e \u003cspan aria-label=\"2\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-2\"\u003e\u003c\/i\u003e\u003c\/span\u003e\u003cspan aria-label=\"Black\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-Black\"\u003e\u003c\/i\u003e\u003c\/span\u003e\u003cspan aria-label=\"Black\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-Black\"\u003e\u003c\/i\u003e\u003c\/span\u003e\u003cbr\u003e\u003cstrong\u003eColor:\u003c\/strong\u003e \u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_mana_type=Black\u0026amp;sort_by=best-selling\"\u003eBlack\u003c\/a\u003e\u003c\/p\u003e\u003cp\u003eDestroy target creature or planeswalker.\u003c\/p\u003e\u003cp\u003e\"I can think of no fate more fitting for one so foul as you.\"\u003cbr\u003e—Aryel, knight of Windgrace\u003c\/p\u003e\u003chr\u003e\u003ch3\u003eFell Mire\u003c\/h3\u003e\u003cp\u003e\u003cstrong\u003eSet:\u003c\/strong\u003e \u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_card_expansion=Modern+Horizons+3\u0026amp;sort_by=best-selling\"\u003eModern Horizons 3\u003c\/a\u003e\u003cbr\u003e\u003cstrong\u003eType:\u003c\/strong\u003e Land\u003cbr\u003e\u003cstrong\u003eColor:\u003c\/strong\u003e \u003ca href=\"https:\/\/amhobbyshop.com\/collections\/magic-the-gathering-singles?filter.v.price.gte=\u0026amp;filter.v.price.lte=\u0026amp;filter.p.m.custom.magic_mana_type=Black\u0026amp;sort_by=best-selling\"\u003eBlack\u003c\/a\u003e\u003c\/p\u003e\u003cp\u003eAs this land enters, you may pay 3 life. If you don't, it enters tapped.\u003cbr\u003e\u003cspan aria-label=\"Tap\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-Tap\"\u003e\u003c\/i\u003e\u003c\/span\u003e: Add \u003cspan aria-label=\"Black\"\u003e\u003ci role=\"presentation\" class=\"icon-small icon-mtg-Black\"\u003e\u003c\/i\u003e\u003c\/span\u003e.\u003c\/p\u003e\u003cp\u003e\"The Nethermire is all the salvation you deserve.\"\u003cbr\u003e—Aryel, knight of Windgrace\u003c\/p\u003e","brand":"Wizards of the Coast","offers":[{"title":"Default Title","offer_id":46516741996695,"sku":null,"price":4.89,"currency_code":"USD","in_stock":false}],"thumbnail_url":"\/\/cdn.shopify.com\/s\/files\/1\/0646\/0588\/0471\/files\/mtgcard2025-12-26_215336_c9ymp9.jpg?v=1766849354","url":"https:\/\/amhobbyshop.com\/products\/fell_the_profane_-_fell_mire_mh3_244","provider":"A\u0026M Hobby Shop","version":"1.0","type":"link"}