fix(styles): write a paragraph margin's hp:default at twice hp:case - #206
Merged
Merged
Conversation
apply_paragraph_format() wrote the same value into both copies of a margin inside hp:switch. Hancom keeps hp:default at twice the hp:case value (the new-document template and the Hancom-saved fixtures do too), so a reader of the default branch saw an edited margin, indent or paragraph spacing at half its size. A margin outside hp:switch is written as given. The DEV-018 probe and the paragraph-format target tests expected one value in both branches; they now read hp:case (and the probe checks hp:default at twice it). The DEV-018 note and a read-model comment said the two copies hold the same value; they now say the margins in hp:default are doubled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fold the direct hh:margin fallback into two lines so the margin scale change adds no lines to the owner file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
apply_paragraph_format()으로 여백·들여쓰기·문단 간격을 바꿀 때hp:switch안의hp:default에는hp:case값의 두 배를 씁니다.한컴은 문단 여백을 두 번 씁니다.
hp:case(HwpUnitChar)에는 HWPUNIT 값을 쓰고,hp:default에는 그 값의 두 배를 씁니다. 새 문서 템플릿과 저장소에 있는 한컴 문서 fixture도 같은 방식으로 쓰여 있습니다. 지금은 두 곳에 같은 값을 쓰기 때문에,hp:case를 모르고hp:default를 읽는 프로그램에서는 바꾼 여백이 절반으로 보입니다.hp:case를 읽는 한/글에서는 보이는 결과가 달라지지 않습니다.변경
oxml/header_part.py_apply_paragraph_margins():hp:switch/hp:default안의hh:margin에는 요청 값의 두 배를 씁니다.hp:switch밖에 있는 여백은 준 값을 그대로 씁니다.tests/test_paragraph_margin_default_scale.py: 테스트 8개를 추가했습니다. 이 중 7개는 수정 전에 실패합니다.hp:default가hp:case의 두 배가 됩니다.m7_toc_gold/hancom-native-toc-A.hwpx,m3_gongmun_gold/seoul_sihaengmun.hwpx)의 본문 문단 전체에 여백을 주고 저장한 뒤 다시 엽니다. 이때 모든 문단 모양이 그 문서 자신의 표기(hp:default=hp:case× 2)를 따릅니다.hp:switch밖의 여백은 두 배가 되지 않습니다. 이 테스트는 수정 전에도 통과하는 보호 테스트입니다.tests/test_paragraph_format_targets.py: 도우미가 두 갈래의 간격 값을 한 집합으로 모아 값 하나를 기대했습니다. 이제 한/글이 읽는 값(hp:case, 또는hp:switch밖의 여백)만 봅니다.probes/dev018_switch_case_default_schema_absence.py: 여백 설정이 두 갈래에 모두 닿는지 보는 탐침이 두 갈래에 같은 값을 기대했습니다. 이제hp:case에는 준 값이,hp:default에는 그 두 배가 들어가는지 봅니다.docs/owpml-deviations.md의 DEV-018 설명과oxml/header.py읽기 모델 주석: 두 갈래가 같은 값이라고 적은 부분을, 여백은hp:default에 두 배가 든다고 고쳤습니다. 읽기 모델은 전처럼hp:case를 먼저 읽습니다.CHANGELOG.md에 고침 항목을 추가했습니다.검증
scripts/check_typing_generics_scope.py,scripts/error_code_census.py --check,scripts/check_public_hygiene.py가 통과합니다.oxml/header_part.py의 줄 수는 그대로입니다(1,594줄). 같은 파일을 고치는 다른 열린 변경과 합쳐도 소유 파일 상한(1,600줄) 안에 들도록, 직속hh:margin을 만드는 바로 위 호출을 두 줄로 묶었습니다(a92a6b4, 동작은 같음). 그 뒤 관련 테스트 138개와 위 검사를 다시 돌려 통과했습니다.🤖 Generated with Claude Code