在生成图像时,代码行会重叠或合并
作者: HUMANCODERMJ创建于 2026年6月13日更新于 2026年8月13日
标签bug
Bug Report: Text overlapping issue when exporting Python code Describe the bug When using Carbon (carbon.now.sh) to export images or copy snippets containing Python code, specific lines of code, particularly those involving object attribute assignment or method calls like app.state.db = mongodb_client.get_database("my_nosql_db"), result in text overlapping and rendering irregularities in the final output. This appears to be specific to the Python language syntax rendering within the tool. To Reproduce Steps to reproduce the behavior: 1. Go to https://carbon.now.sh/ 2. Select 'Python' from the language dropdown menu. 3. Paste or write a line of code such as app.state.db = mongodb_client.get_database("my_nosql_db"). 4. Click 'Export' to generate an image or use the 'Copy Image/Code' function. 5. Observe that the text in the generated output is overlapped and visually corrupted. Expected behavior The generated image or copied code should display the Python code clearly with proper character spacing, without any text overlapping or rendering artifacts, regardless of the line length or specific method syntax. Screenshots
* OS: Windows * Browser: Chrome * Carbon URL: [URL](https://carbon.now.sh/?bg=rgba%28171%2C+184%2C+195%2C+1%29&t=one-dark&wt=none&l=Python&width=680&ds=true&dsyoff=20px&dsblur=68px&wc=true&wa=true&pv=56px&ph=56px&ln=false&fl=1&fm=Hack&fs=14px&lh=133%25&si=false&es=2x&wm=false&code=from%2520fastapi%2520import%2520FastAPI%252C%2520Request%250Afrom%2520pymongo%2520import%2520AsyncMongoClient%250Afrom%2520contextlib%2520import%2520asynccontextmanager%250A%2540asynccontextmanager%250Aasync%2520def%2520lifespan%28app%253A%2520FastAPI%29%253A%250A%2520%2520%2520%2520%250A%2520%2520%2520%2520%2523%25201.%2520Initialize%2520the%2520native%2520PyMongo%2520Async%2520Client%250A%2520%2520%2520%2520mongodb_client%2520%253D%2520AsyncMongoClient%28%250A%2520%2520%2520%2520%2520%2520%2520%2520%2522mongodb%253A%252F%252Fuser%253Apassword%2540localhost%253A27017%252F%2522%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520maxPoolSize%253D50%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520minPoolSize%253D10%252C%250A%2520%2520%2520%2520%2520%2520%2520%2520maxIdleTimeMS%253D60000%250A%2520%2520%2520%2520%250A%2520%2520%2520%2520%2523%25202.%2520Attach%2520the%2520database%2520to%2520the%2520app%2520state%250A%2520%2520%2520%2520app.state.db%2520%253D%2520mongodb_client.get_database%28%2522my_nosql_db%2522%29%250A%2520%2520%2520%2520print%28%2522PyMongo%2520AsyncClient%2520connected%21%2522%29%250A%2520%2520%2520%2520yield%2520%2523%2520App%2520runs%2520here%250A%2520%2520%2520%2520%250A%2520%2520%2520%2520%2523%25203.%2520Clean%2520up%2520on%2520shutdown%250A%2520%2520%2520%2520await%2520mongodb_client.close%28%2
内容来源: carbon-app/carbon